From 3e3fa955fb2e18f3c91a216f987c682189d3ce35 Mon Sep 17 00:00:00 2001 From: Vivek Goyal Date: Mon, 4 Feb 2019 13:34:54 -0500 Subject: [PATCH] overlay/060: Use falloc to make sure a meta copy file got copied up 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 Reviewed-by: Amir Goldstein Signed-off-by: Eryu Guan --- tests/overlay/060 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/overlay/060 b/tests/overlay/060 index 2e0764e9..77ff0148 100755 --- a/tests/overlay/060 +++ b/tests/overlay/060 @@ -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 -- 2.39.5