Skip to contentSkip to conversation

xfstest, overlayfs: Use falloc to make sure a meta copy file got copied up

PATCH In review Vivek Goyal 2 participants 2 messages Feb 4, 2019

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfstest, overlayfs: 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.

---
 tests/overlay/060 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
tests/overlay/060 +1 -1
Index: xfstests-dev/tests/overlay/060
===================================================================
@@ -170,7 +170,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
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Vivek Goyal

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.

Quoted 17 lines
---
 tests/overlay/060 |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: xfstests-dev/tests/overlay/060
===================================================================

tests/overlay/060 2019-02-04 11:28:09.023718690 -0500 renamed from tests/overlay/060 2018-08-27 11:21:51.811847671 -0400 +1 -1
@@ -170,7 +170,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