On Sun, Apr 18, 2021 at 08:25:48PM +0800, Eryu Guan wrote: > > diff --git a/tests/generic/223 b/tests/generic/223 > > index 1f85efe5..a5ace82f 100755 > > --- a/tests/generic/223 > > +++ b/tests/generic/223 > > @@ -43,6 +43,9 @@ for SUNIT_K in 8 16 32 64 128; do > > _scratch_mkfs_geom $SUNIT_BYTES 4 $BLOCKSIZE >> $seqres.full 2>&1 > > _scratch_mount > > > > + # Make sure everything is on the data device > > + $XFS_IO_PROG -c 'chattr -t' $SCRATCH_MNT > > What does this do for non-xfs filesystems? Do we need a FSTYP check and > do chattr only on XFS? This clears the FS_NOTAIL_FL flag, which prevents tail merging, on the root directory of the mounted scratch file system. That should be harmless on non-xfs file systems; in fact, the only file system that even uses NOTAIL_FL flag is reiserfs, and the NOTAIL_FL flag is not set by default on the root directory of a newly created reiserfs file system. However, by default reiserfs does not support the FS_IOC_{GET,SET}FLAGS ioctl unless the mount option "attrs" is given. Why, I have no idea: root@kvm-xfstests:~# mount -t reiserfs /vtmp/foo.img /mnt root@kvm-xfstests:~# xfs_io -c 'chattr -t' /mnt xfs_io: cannot get flags on /mnt: Inappropriate ioctl for device So it might be a good idea to redirect stderr for the xfs_io invocation to /dev/null, for those file systems which do not support the FS_IOC_{GET,SET}FLAGS ioctls. I also have no idea why this helps for xfs --- I would think it's a no-op, but I'm guessing there's some magical side-effect which is taking place when FS_IOC_SETFLAGS ioctl is processed? Maybe it would be worth a comment explaining what is going on --- and whether this is going to make any difference if the patch series which unifies FS_IOC_{GETSET}FLAGS handling is merged? - Ted