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>
# 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
# 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