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.
Signed-off-by: Amir Goldstein <amir73il@gmail.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Eryu Guan <eguan@redhat.com>
sz=$((blksz * blocks))
echo "Mount otherdir"
-SCRATCH_MNT=$otherdir _scratch_mount
+$MOUNT_PROG --bind $SCRATCH_MNT $otherdir
echo "Create file"
_pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
test -e $othertestdir/otherfile && echo "otherfile should not exist"
echo "Unmount otherdir"
-SCRATCH_MNT=$otherdir _scratch_unmount
+$UMOUNT_PROG $otherdir
rm -rf $otherdir
# success, all done
sz=$((blocks * blksz))
echo "Mount otherdir"
-SCRATCH_MNT=$otherdir _scratch_mount
+$MOUNT_PROG --bind $SCRATCH_MNT $otherdir
echo "Create file"
_pwrite_byte 0x61 0 $sz $testdir/file >> $seqres.full
md5sum $testdir/file $othertestdir/otherfile | filter_md5
echo "Unmount otherdir"
-SCRATCH_MNT=$otherdir _scratch_unmount
+$UMOUNT_PROG $otherdir
rm -rf $otherdir
# success, all done