generic/60[78]: ensure the initial DAX file flag state before test
authorDarrick J. Wong <djwong@kernel.org>
Tue, 2 Mar 2021 23:22:56 +0000 (15:22 -0800)
committerEryu Guan <guaneryu@gmail.com>
Sun, 7 Mar 2021 16:41:13 +0000 (00:41 +0800)
Since this test checks the behaviors of both the in-core S_DAX flag and
the ondisk FS_XFLAG_DAX inode flags, it must be careful about the
initial state of the filesystem w.r.t. the inode flag.

Make sure that the root directory does /not/ have the inode flag set
before we begin testing, so that the initial state doesn't throw off
inheritance testing.

[Eryu: change chattr command to xfs_io -c 'chattr']

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Chandan Babu R <chandanrlinux@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/generic/607
tests/generic/608

index dd6dbd6..db4e7cf 100755 (executable)
@@ -156,6 +156,10 @@ do_xflag_tests()
        local option=$1
 
        _scratch_mount "$option"
+
+       # Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
+       $XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT &>> $seqres.full
+
        cd $SCRATCH_MNT
 
        for i in $(seq 1 5); do
index dd89d91..861bbff 100755 (executable)
@@ -98,6 +98,9 @@ do_tests()
 
        _scratch_mount "$mount_option"
 
+       # Make sure the root dir doesn't have FS_XFLAG_DAX set before we start.
+       $XFS_IO_PROG -c "chattr -x" $SCRATCH_MNT &>> $seqres.full
+
        test_drop_caches
 
        test_cycle_mount "$cycle_mount_option"