]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
overlay/04{1,3,4}: enable xino feature
authorAmir Goldstein <amir73il@gmail.com>
Thu, 26 Apr 2018 05:53:27 +0000 (23:53 -0600)
committerEryu Guan <guaneryu@gmail.com>
Fri, 27 Apr 2018 02:46:29 +0000 (10:46 +0800)
These tests check for constant inode number on copy up with
nonsamefs layer configuration. This problem is fixes only when
opting-in with the xino=on mount option, so let the tests enable the
mount option on new kernels and notrun on old kernels.

Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Eryu Guan <guaneryu@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/overlay/041
tests/overlay/043
tests/overlay/044

index f3be746a0f33ae532938fca46f1023b4692d2ab6..458c900893c872b4a40a7ab2280b16cd858a0400 100755 (executable)
@@ -70,7 +70,14 @@ _scratch_mkfs
 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
 workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir
+# Enabling xino in this test requires that base filesystem inode numbers will
+# not use bit 63 in inode number of the test files, because bit 63 is used by
+# overlayfs to indicate the layer. Let's just assume that this is true for all
+# tested filesystems and if we are wrong, the test may fail.
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o xino=on || \
+       _notrun "cannot mount overlay with xino=on option"
+_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
+       _notrun "cannot enable xino feature"
 
 test_dir=$SCRATCH_MNT/test_dir/
 
@@ -171,7 +178,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino)
 $UMOUNT_PROG $SCRATCH_MNT
 
 # check overlayfs
-_overlay_check_scratch_dirs $lowerdir $upperdir $workdir
+_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o xino=on
 
 # Verify pure lower residing in dir which has another lower layer
 middir=$OVL_BASE_TEST_DIR/$seq-ovl-mid
@@ -186,7 +193,7 @@ mkdir -p $lowerdir/test_dir/pure_lower_dir/subdir
 
 _scratch_mkfs
 
-_overlay_scratch_mount_dirs $middir:$lowerdir $upperdir $workdir
+_overlay_scratch_mount_dirs $middir:$lowerdir $upperdir $workdir -o xino=on
 
 # Copy up test_dir
 touch $test_dir/test_file
@@ -209,7 +216,7 @@ subdir_d=$($here/src/t_dir_type $pure_lower_dir $pure_lower_subdir_st_ino)
        echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for subdir"
 
 # check overlayfs
-_overlay_check_scratch_dirs "$middir:$lowerdir" $upperdir $workdir
+_overlay_check_scratch_dirs "$middir:$lowerdir" $upperdir $workdir -o xino=on
 
 echo "Silence is golden"
 status=0
index f70ee7f6f3cf78235923d4a8cfdcd107b440ea2d..d11459cfd90d4d7946e6ff48d07432e5e9ff7aeb 100755 (executable)
@@ -85,8 +85,15 @@ _scratch_mkfs >>$seqres.full 2>&1
 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
 workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 
-# Enable redirect_dir for renaming a merge directory
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on
+# Enable redirect_dir for renaming a merge directory.
+# Enabling xino in this test requires that base filesystem inode numbers will
+# not use bit 63 in inode number of the test files, because bit 63 is used by
+# overlayfs to indicate the layer. Let's just assume that this is true for all
+# tested filesystems and if we are wrong, the test may fail.
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on || \
+       _notrun "cannot mount overlay with xino=on option"
+_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
+       _notrun "cannot enable xino feature"
 
 FILES="dir file symlink chrdev blkdev fifo socket"
 
@@ -153,13 +160,13 @@ check_inode_numbers $testdir $tmp.after_copyup $tmp.after_move
 
 # Verify that the inode numbers survive a mount cycle
 $UMOUNT_PROG $SCRATCH_MNT
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on
 
 # Compare inode numbers before/after mount cycle
 check_inode_numbers $testdir $tmp.after_move $tmp.after_cycle
 
 # check overlayfs
-_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o redirect_dir=on
+_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o redirect_dir=on,xino=on
 
 echo "Silence is golden"
 status=0
index 2ab3035eedf80587355a85daab2ffba9a2dac690..7b07f3ce1104fe0744ead760ca705e647525ac0a 100755 (executable)
@@ -99,8 +99,15 @@ _scratch_mkfs >>$seqres.full 2>&1
 upperdir=$OVL_BASE_SCRATCH_MNT/$OVL_UPPER
 workdir=$OVL_BASE_SCRATCH_MNT/$OVL_WORK
 
-# Enable overlay index feature to prevent breaking hardlinks on copy up
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on
+# Enable overlay index feature to prevent breaking hardlinks on copy up.
+# Enabling xino in this test requires that base filesystem inode numbers will
+# not use bit 63 in inode number of the test files, because bit 63 is used by
+# overlayfs to indicate the layer. Let's just assume that this is true for all
+# tested filesystems and if we are wrong, the test may fail.
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on || \
+       _notrun "cannot mount overlay with xino=on option"
+_fs_options $SCRATCH_DEV | grep -q "xino=on" || \
+       _notrun "cannot enable xino feature"
 
 rm -f $tmp.*
 
@@ -124,8 +131,8 @@ check_ino_nlink $SCRATCH_MNT $tmp.before $tmp.after_one
 
 # Verify that the hardlinks survive a mount cycle
 $UMOUNT_PROG $SCRATCH_MNT
-_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on
-_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on
+_overlay_check_scratch_dirs $lowerdir $upperdir $workdir -o index=on,xino=on
+_overlay_scratch_mount_dirs $lowerdir $upperdir $workdir -o index=on,xino=on
 
 echo "== After mount cycle =="
 cat $FILES