Whamcloud - gitweb
LU-13397 lfs: mirror resync to keep sparseness 73/40773/11
authorMikhail Pershin <mpershin@whamcloud.com>
Wed, 25 Nov 2020 16:05:05 +0000 (19:05 +0300)
committerOleg Drokin <green@whamcloud.com>
Tue, 6 Apr 2021 03:02:03 +0000 (03:02 +0000)
commit4126fbb30c125050ea2e1fdf3d446201b826ce29
treefe910038dc992eed26067f2e375c9975a4455a5d
parent77f5bb4dace53e0040dea4ce5c72156e901e6819
LU-13397 lfs: mirror resync to keep sparseness

Use SEEK_HOLE/SEEK_DATA in llapi_mirror_resync_many() to
copy just data chunks between components. Holes at the last
component are done with truncate(), holes in other components
are done with fallocate(FALLOC_FL_PUNCH_HOLE). In case of any
punch() error the hole is just copied via read(), i.e. as zeroes

Currently fallocate(FALLOC_FL_PUNCH_HOLE) is not supported yet,
so resync preserves sparseness only for last components

Signed-off-by: Mikhail Pershin <mpershin@whamcloud.com>
Change-Id: Id249739c5cd2d1c8a998da3341d326de1a8b8d32
Reviewed-on: https://review.whamcloud.com/40773
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/include/lustre/lustreapi.h
lustre/tests/sanity-flr.sh
lustre/utils/liblustreapi_layout.c
lustre/utils/liblustreapi_lseek.c
lustre/utils/liblustreapi_mirror.c