Skip to contentSkip to conversation

overlay/038: Miscellaneous fixes

PATCH In review Chandan Rajendra 2 participants 3 messages Oct 8, 2017 – Oct 15, 2017

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 overlay/038: Miscellaneous fixes

This commit removes the redundant chown operation which was supposed to cause the test file to be copied up. Also, _overlay_scratch_unmount() is used to unmount the overlay filesystem rather than invoking $UMOUNT_PROG.

---
 tests/overlay/038 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
tests/overlay/038 +3 -5
index 57281fa..148995b 100755
@@ -1,7 +1,7 @@
 #! /bin/bash
 # FSQA Test No. 038
 #
-# Test constant d_ino numbers
+# Test consistent d_ino numbers for samefs setup.
 #
 #-----------------------------------------------------------------------
 #
@@ -102,10 +102,8 @@ current_d=$($here/src/t_dir_type $impure_dir $impure_dir_st_ino)
 [[ $current_d == ". d" ]] || \
     echo "Before dir becomes impure: Invalid d_ino reported for ."
 
-chown -h 100 $SCRATCH_MNT/test_file
-test_file_st_ino=$(stat -c '%i' $SCRATCH_MNT/test_file)
-
 mv $SCRATCH_MNT/test_file $impure_dir
+test_file_st_ino=$(stat -c '%i' $impure_dir/test_file)
 
 impure=$($GETFATTR_PROG --absolute-names --only-values -n 'trusted.overlay.impure' \
 			$upperdir/test_dir/impure_dir)
@@ -187,7 +185,7 @@ parent_d=$($here/src/t_dir_type $SCRATCH_MNT/test_dir/pure_lower_dir $test_dir_s
 [[ $parent_d == ".. d" ]] || \
 	echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for .."
 
-$UMOUNT_PROG $SCRATCH_MNT
+_overlay_scratch_unmount
 
 echo "Silence is golden"
 status=0
Signature · 1 line
2.9.5
#1 lore raw
Quoted 35 lines · Chandan Rajendra

This commit removes the redundant chown operation which was supposed to cause the test file to be copied up. Also, _overlay_scratch_unmount() is used to unmount the overlay filesystem rather than invoking $UMOUNT_PROG.

---
 tests/overlay/038 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
tests/overlay/038 +2 -4
index 57281fa..148995b 100755
@@ -1,7 +1,7 @@
 #! /bin/bash
 # FSQA Test No. 038
 #
-# Test constant d_ino numbers
+# Test consistent d_ino numbers for samefs setup.
 #
 #-----------------------------------------------------------------------
 #
@@ -102,10 +102,8 @@ current_d=$($here/src/t_dir_type $impure_dir $impure_dir_st_ino)
 [[ $current_d == ". d" ]] || \
     echo "Before dir becomes impure: Invalid d_ino reported for ."
 
-chown -h 100 $SCRATCH_MNT/test_file
-test_file_st_ino=$(stat -c '%i' $SCRATCH_MNT/test_file)
-
 mv $SCRATCH_MNT/test_file $impure_dir
+test_file_st_ino=$(stat -c '%i' $impure_dir/test_file)
 
 impure=$($GETFATTR_PROG --absolute-names --only-values -n 'trusted.overlay.impure' \
                        $upperdir/test_dir/impure_dir)

tests/overlay/038 parent_d=$($here/src/t_dir_type $SCRATCH_MNT/test_dir/pure_lower_dir $test_dir_s · line 189

Quoted 6 lines
tests/overlay/038 +1 -1
@@ -187,7 +185,7 @@ parent_d=$($here/src/t_dir_type $SCRATCH_MNT/test_dir/pure_lower_dir $test_dir_s
 [[ $parent_d == ".. d" ]] || \
        echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for .."
 
-$UMOUNT_PROG $SCRATCH_MNT
+_overlay_scratch_unmount
 

Neither variant is really needed at end of test but fine.

Quoted 5 lines
tests/overlay/038 +0 -1
 echo "Silence is golden"
 status=0
--

2.9.5

#2 lore raw
Quoted 40 lines · Amir Goldstein
Quoted 38 lines · Chandan Rajendra

This commit removes the redundant chown operation which was supposed to cause the test file to be copied up. Also, _overlay_scratch_unmount() is used to unmount the overlay filesystem rather than invoking $UMOUNT_PROG.

---
 tests/overlay/038 | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)
tests/overlay/038 +2 -4
index 57281fa..148995b 100755
@@ -1,7 +1,7 @@
 #! /bin/bash
 # FSQA Test No. 038
 #
-# Test constant d_ino numbers
+# Test consistent d_ino numbers for samefs setup.
 #
 #-----------------------------------------------------------------------
 #
@@ -102,10 +102,8 @@ current_d=$($here/src/t_dir_type $impure_dir $impure_dir_st_ino)
 [[ $current_d == ". d" ]] || \
     echo "Before dir becomes impure: Invalid d_ino reported for ."
 
-chown -h 100 $SCRATCH_MNT/test_file
-test_file_st_ino=$(stat -c '%i' $SCRATCH_MNT/test_file)
-
 mv $SCRATCH_MNT/test_file $impure_dir
+test_file_st_ino=$(stat -c '%i' $impure_dir/test_file)
 
 impure=$($GETFATTR_PROG --absolute-names --only-values -n 'trusted.overlay.impure' \
                        $upperdir/test_dir/impure_dir)
@@ -187,7 +185,7 @@ parent_d=$($here/src/t_dir_type $SCRATCH_MNT/test_dir/pure_lower_dir $test_dir_s
 [[ $parent_d == ".. d" ]] || \
        echo "Pure lower in dir which has another lower layer: Invalid d_ino reported for .."
 
Quoted 6 lines

tests/overlay/038 parent_d=$($here/src/t_dir_type $SCRATCH_MNT/test_dir/pure_lower_dir $test_dir_s · line 189

Quoted 3 lines
tests/overlay/038 +1 -1
-$UMOUNT_PROG $SCRATCH_MNT
+_overlay_scratch_unmount
 

Neither variant is really needed at end of test but fine.

This got merged with _overlay_scratch_unmount which is not intended to be used directly. I overlooked this in review. Not really a problem though. Should probably remove this final umount from the test in a cleanup patch.

Amir.