From: Bobi Jam Date: Sat, 23 Sep 2023 16:18:36 +0000 (+0800) Subject: LU-16896 flr: resync could mess mirror content X-Git-Tag: 2.15.59~21 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1b694ad04f099924cb5760cbaf1f09e5843975aa;p=fs%2Flustre-release.git LU-16896 flr: resync could mess mirror content This could happens in this case: a component with extent [0, 0x1000) being synced with another mirror with data in [0x100, 0x200) and file size is 0x300. The out-of-sync mirror will get punched in [0, 0x100) and data being correctly written in [0x100, 0x200), but will be missed the punch in [0x200, 0x300) even though it can be correctly truncated at 0x300. Fixes: b9ce342ee1 ("LU-16896 flr: resync should not change file size") Signed-off-by: Bobi Jam Change-Id: If81433260f42c6161a53157cc0dd9d115eabbfb9 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52489 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin --- diff --git a/lustre/utils/liblustreapi_layout.c b/lustre/utils/liblustreapi_layout.c index 8155578..374e9e1 100644 --- a/lustre/utils/liblustreapi_layout.c +++ b/lustre/utils/liblustreapi_layout.c @@ -3086,7 +3086,7 @@ int llapi_mirror_resync_many_params(int fd, struct llapi_layout *layout, */ rc = llapi_mirror_truncate(fd, mid, cur_pos); - else if (data_size) + else if (to_punch) rc = llapi_mirror_punch(fd, mid, cur_pos, to_punch); /**