zfs icon indicating copy to clipboard operation
zfs copied to clipboard

ZTS: add mount_loopback to test zfs behind loop dev

Open tonyhutter opened this issue 7 months ago • 5 comments

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.

tonyhutter avatar May 12 '25 20:05 tonyhutter

@behlendorf I included your fixes in my latest push.

tonyhutter avatar May 15 '25 16:05 tonyhutter

Two thoughts:

  • 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)
  • 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 avatar May 16 '25 00:05 robn

@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".

tonyhutter avatar May 16 '25 17:05 tonyhutter

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)

amotin avatar May 19 '25 16:05 amotin

This still fails (skips) almalinux8 and debian11.

amotin avatar Jun 06 '25 03:06 amotin