ZTS: add mount_loopback to test zfs behind loop dev
Motivation and Context
Add test for #17277
Description
Add a test case to reproduce issue #17277. This has actually been fixed by https://github.com/openzfs/zfs/pull/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
- [x] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Performance enhancement (non-breaking change which improves efficiency)
- [ ] Code cleanup (non-breaking change which makes code smaller or more readable)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
- [ ] Library ABI change (libzfs, libzfs_core, libnvpair, libuutil and libzfsbootenv)
- [ ] Documentation (a change to man pages or other documentation)
Checklist:
- [ ] My code follows the OpenZFS code style requirements.
- [ ] I have updated the documentation accordingly.
- [ ] I have read the contributing document.
- [ ] I have added tests to cover my changes.
- [ ] I have run the ZFS Test Suite with this change applied.
- [ ] All commit messages are properly formatted and contain
Signed-off-by.
@behlendorf I included your fixes in my latest push.
Two thoughts:
- maybe a skip if you don't have
mkfs.xfsand/or XFS support in your kernel (I routinely don't have those in my tiny VMs) - it's more work, but would we be better to identify the IO pattern that tickled the bug, and write a program to test that? If XFS or the kernel ever changes in the future, the test could end up quietly not actually testing anything useful, and not alerting us to a future break. On the other hand, there's no harm in having a straight up functional "can we even mount a loopback filesystem" test, so as long as we know what this test is, probably nbd.
@robn -
maybe a skip if you don't have mkfs.xfs and/or XFS support in your kernel (I routinely don't have those in my tiny VMs)
Thanks - I just added a check in my latest push
On the other hand, there's no harm in having a straight up functional "can we even mount a loopback filesystem" test, so as long as we know what this test is, probably nbd.
Yes, its just a basic sanity test to verify "filesystem over loopback over ZFS".
It should probably be specified somewhere that skipped test is OK:
Tests with results other than PASS that are unexpected:
SKIP mount/mount_loopback (expected PASS)
This still fails (skips) almalinux8 and debian11.