-
Notifications
You must be signed in to change notification settings - Fork 1.8k
ZTS: add mount_loopback to test zfs behind loop dev #17329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
8415e39
to
c967763
Compare
@behlendorf I included your fixes in my latest push. |
Two thoughts:
|
@robn -
Thanks - I just added a check in my latest push
Yes, its just a basic sanity test to verify "filesystem over loopback over ZFS". |
Add a test case to reproduce issue openzfs#17277: 1. Make a pool 2. Write a file to the pool 3. Mount the file as a loopback device 4. Make an XFS filesystem on the loopback device 5. Mount the XFS filesystem... <hangs> Signed-off-by: Tony Hutter <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice, thanks!
It should probably be specified somewhere that skipped test is OK:
|
if [ ! -d /lib/modules/$(uname -r)/kernel/fs/xfs ] && \ | ||
! grep -qE '\sxfs$' /proc/filesystems ; then | ||
log_unsupported "No XFS kernel support" | ||
fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since xfs may not be built as a kmod it's probably more reliable to check that either CONFIG_XFS_FS=m
or CONFIG_XFS_FS=y
is set in /boot/config-$(uname -r)
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's the /proc/filesystems
check though, right? If it's not a module, then it must be builtin and so in the filesystem list?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@robn that's right - the two checks are to look for modules & built-in filesystems. I actually think the /boot/config-*
check is a little more elegant, but I wasn't 100% sure all distros put their configs in /boot
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems to work for at least the distributions covered by the CI. We already do a similar check for uring support in functional/io/io_uring.ksh
. If you wanted to be fancy you could first check for /proc/config.gz
. Providing the kernel config in /proc/
has been supported for years now, but I'm not sure how commonly it's enabled in distribution kernels.
At least on RHEL8 it's disabled:
/boot/config-4.18.0-553.50.1.el8_10.x86_64:# CONFIG_IKCONFIG is not set
/boot/config-4.18.0-553.51.1.el8_10.x86_64:# CONFIG_IKCONFIG is not set
# 1. Make a pool | ||
# 2. Make a file on the pool or create zvol | ||
# 3. Mount the file/zvol behind a loopback device | ||
# 4. Create & mount an xfs filesystem on the loopback device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not to be greedy, but it'd be nice to have an identical test which uses ext4.
Motivation and Context
Add test for #17277
Description
Add a test case to reproduce issue #17277. This has actually been fixed by #17298, but add a test case for good measure. The test case verifies that we can make an xfs filesystem on a ZFS-backed loopback device.
How Has This Been Tested?
Test case added
Types of changes
Checklist:
Signed-off-by
.