Whamcloud - gitweb
LU-16896 flr: resync could mess mirror content 89/52489/3
authorBobi Jam <bobijam@whamcloud.com>
Sat, 23 Sep 2023 16:18:36 +0000 (00:18 +0800)
committerOleg Drokin <green@whamcloud.com>
Wed, 8 Nov 2023 22:03:39 +0000 (22:03 +0000)
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 <bobijam@whamcloud.com>
Change-Id: If81433260f42c6161a53157cc0dd9d115eabbfb9
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/52489
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Mikhail Pershin <mpershin@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/utils/liblustreapi_layout.c

index 8155578..374e9e1 100644 (file)
@@ -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);
                                /**