]> git.apps.os.sepia.ceph.com Git - xfstests-dev.git/commitdiff
overlay/060: Use falloc to make sure a meta copy file got copied up
authorVivek Goyal <vgoyal@redhat.com>
Mon, 4 Feb 2019 18:34:54 +0000 (13:34 -0500)
committerEryu Guan <guaneryu@gmail.com>
Sun, 10 Feb 2019 09:12:03 +0000 (17:12 +0800)
Overlayfs might copy up data of file on first write of file (and
not necessarily upon open of file). So call falloc file opened
with O_RDWR and after that data must have been copied up.

[Eryu: add _require_xfs_io_command "falloc" to make sure underlying
fs have fallocate(2) support]

Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Eryu Guan <guaneryu@gmail.com>
tests/overlay/060

index 2e0764e9450f96024945c3208184f87496154c8f..77ff01486386c3c047c39bcdd7a6872bb1081a97 100755 (executable)
@@ -36,6 +36,7 @@ _supported_os Linux
 # them explicity after test.
 _require_scratch_nocheck
 _require_scratch_overlay_features index redirect_dir metacopy
+_require_xfs_io_command "falloc"
 
 # remove all files from previous tests
 _scratch_mkfs
@@ -170,7 +171,7 @@ test_common()
 
        # Trigger data copy up and check absence of metacopy xattr.
        mount_overlay $_lowerdir
-       $XFS_IO_PROG -c "open -a $SCRATCH_MNT/$_target"
+       $XFS_IO_PROG -c "falloc 0 1" $SCRATCH_MNT/$_target >> $seqres.full
        echo "check properties of data copied up file"
        check_file_size_contents $SCRATCH_MNT/$_target $_size "$_data"
        umount_overlay