From f829227f49117c4466bab88e90c187b273211c5f Mon Sep 17 00:00:00 2001 From: Tony Hutter Date: Fri, 30 Oct 2020 08:47:42 -0700 Subject: ZTS: Fix xattr_004_pos failure, don't use tmpfs Previously, xattr_004_pos would create files with xattrs on both tmpfs and ext2, and then copy them to zfs to verify that their xattrs were preserved. However tmpfs doesn't support xattrs. This was never noticed until Fedora 33. In Fedora 32 and older, /tmp was on the root partition (like ext4), whereas on Fedora 33 /tmp is actually tmpfs. That caused this test to fail on Fedora 33. This fix updates the test to only create the file on ext2, not tmpfs. Reviewed-by: Brian Behlendorf Signed-off-by: Tony Hutter Closes #11133 --- .../tests/functional/xattr/xattr_004_pos.ksh | 34 +++++----------------- 1 file changed, 7 insertions(+), 27 deletions(-) diff --git a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh index 0a25d7ac5..786322b30 100755 --- a/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh +++ b/tests/zfs-tests/tests/functional/xattr/xattr_004_pos.ksh @@ -33,11 +33,11 @@ # # DESCRIPTION: # -# Creating files on ufs|ext and tmpfs, and copying those files to ZFS with -# appropriate cp flags, the xattrs will still be readable. +# Create files on ufs|ext, copy those files to ZFS with appropriate cp flags, +# and verify the xattrs will still be readable. # # STRATEGY: -# 1. Create files in ufs|ext and tmpfs with xattrs +# 1. Create files in ufs|ext with xattrs # 2. Copy those files to zfs # 3. Ensure the xattrs can be read and written # 4. Do the same in reverse. @@ -54,7 +54,7 @@ function cleanup { fi } -log_assert "Files from $NEWFS_DEFAULT_FS,tmpfs with xattrs copied to zfs retain xattr info." +log_assert "Files from $NEWFS_DEFAULT_FS with xattrs copied to zfs retain xattr info." log_onexit cleanup # Create a ufs|ext file system that we can work in @@ -63,28 +63,23 @@ block_device_wait log_must eval "new_fs $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol > /dev/null 2>&1" log_must mkdir /tmp/$NEWFS_DEFAULT_FS.$$ -log_must mkdir /tmp/tmpfs.$$ if is_illumos; then log_must mount $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol \ /tmp/$NEWFS_DEFAULT_FS.$$ - # Create files in ufs and tmpfs, and set some xattrs on them. + # Create files in ufs, and set some xattrs on them. log_must touch /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ - log_must touch /tmp/tmpfs-file.$$ log_must runat /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ \ cp /etc/passwd . - log_must runat /tmp/tmpfs-file.$$ cp /etc/group . # copy those files to ZFS log_must cp -@ /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ \ $TESTDIR - log_must cp -@ /tmp/tmpfs-file.$$ $TESTDIR # ensure the xattr information has been copied correctly log_must runat $TESTDIR/$NEWFS_DEFAULT_FS-file.$$ \ diff passwd /etc/passwd - log_must runat $TESTDIR/tmpfs-file.$$ diff group /etc/group log_must umount /tmp/$NEWFS_DEFAULT_FS.$$ else @@ -94,21 +89,15 @@ else log_must mount ${options:+""} \ $ZVOL_DEVDIR/$TESTPOOL/$TESTFS/zvol /tmp/$NEWFS_DEFAULT_FS.$$ - # Create files in ext and tmpfs, and set some xattrs on them. + # Create files in ext, and set some xattrs on them. # Use small values for xattrs for ext compatibility. log_must touch /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ echo "TEST XATTR" >/tmp/xattr1 - echo "1234567890" >/tmp/xattr2 log_must set_xattr_stdin xattr1 \ /tmp/$NEWFS_DEFAULT_FS.$$/$NEWFS_DEFAULT_FS-file.$$ /tmp/xattr2.$$" - log_must diff /tmp/xattr2.$$ /tmp/xattr2 - log_must rm /tmp/tmpfs-file.$$ - log_must rm /tmp/xattr2 /tmp/xattr2.$$ - fi - log_must umount /tmp/$NEWFS_DEFAULT_FS.$$ fi -log_pass "Files from $NEWFS_DEFAULT_FS,tmpfs with xattrs copied to zfs retain xattr info." +log_pass "Files from $NEWFS_DEFAULT_FS with xattrs copied to zfs retain xattr info." -- cgit v1.2.3