generic: use bind mount instead of 2nd _scratch_mount
PATCH 1/1 generic: use bind mount instead of 2nd _scratch_mount
generic/373 and generic/374 test that cross-mountpoint reflink/dedupe fail with EXDEV.
For this test, _scratch_mount is called a 2nd time with same mount arguments, but a different value of SCRATCH_MNT.
This practice is incorrect for overlayfs, which should not be using the same upper/work dirs on two different overlay super blocks.
Change the test to use bind mount instead, which results in the expected setup for both block device mount and overlay mount.
--- tests/generic/373 | 4 ++-- tests/generic/374 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
tests/generic/373 +2 -2
@@ -64,7 +64,7 @@ blksz=65536 sz=$((blksz * blocks)) echo "Mount otherdir" -SCRATCH_MNT=$otherdir _scratch_mount +mount --bind $SCRATCH_MNT $otherdir echo "Create file" _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
@@ -82,7 +82,7 @@ md5sum $testdir/file | _filter_scratch test -e $othertestdir/otherfile && echo "otherfile should not exist" echo "Unmount otherdir" -SCRATCH_MNT=$otherdir _scratch_unmount +umount $otherdir rm -rf $otherdir # success, all done
tests/generic/374 +2 -2
@@ -63,7 +63,7 @@ blksz=65536 sz=$((blocks * blksz)) echo "Mount otherdir" -SCRATCH_MNT=$otherdir _scratch_mount +mount --bind $SCRATCH_MNT $otherdir echo "Create file" _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
@@ -80,7 +80,7 @@ echo "Check output" md5sum $testdir/file $othertestdir/otherfile | filter_md5 echo "Unmount otherdir" -SCRATCH_MNT=$otherdir _scratch_unmount +umount $otherdir rm -rf $otherdir # success, all done
Signature · 1 line
2.7.4
Quoted 11 lines · Amir Goldstein
generic/373 and generic/374 test that cross-mountpoint reflink/dedupe fail with EXDEV.
For this test,
_scratch_mountis called a 2nd time with same mount arguments, but a different value ofSCRATCH_MNT.This practice is incorrect for overlayfs, which should not be using the same upper/work dirs on two different overlay super blocks.
Change the test to use bind mount instead, which results in the expected setup for both block device mount and overlay mount.
Looks ok,
--D
Quoted 54 lines
Signed-off-by Amir Goldstein <[email protected]>--- tests/generic/373 | 4 ++-- tests/generic/374 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)tests/generic/373 +2
-2@@ -64,7 +64,7 @@ blksz=65536 sz=$((blksz * blocks)) echo "Mount otherdir" -SCRATCH_MNT=$otherdir _scratch_mount +mount --bind $SCRATCH_MNT $otherdir echo "Create file" _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full@@ -82,7 +82,7 @@ md5sum $testdir/file | _filter_scratch test -e $othertestdir/otherfile && echo "otherfile should not exist" echo "Unmount otherdir" -SCRATCH_MNT=$otherdir _scratch_unmount +umount $otherdir rm -rf $otherdir # success, all donetests/generic/374 +2
-2@@ -63,7 +63,7 @@ blksz=65536 sz=$((blocks * blksz)) echo "Mount otherdir" -SCRATCH_MNT=$otherdir _scratch_mount +mount --bind $SCRATCH_MNT $otherdir echo "Create file" _pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full@@ -80,7 +80,7 @@ echo "Check output" md5sum $testdir/file $othertestdir/otherfile | filter_md5 echo "Unmount otherdir" -SCRATCH_MNT=$otherdir _scratch_unmount +umount $otherdir rm -rf $otherdir # success, all doneSignature · 1 line
2.7.4