Whamcloud - gitweb
LU-16813 utils: move mirror_end initialization 19/50919/3
authorTimothy Day <timday@amazon.com>
Wed, 10 May 2023 07:32:51 +0000 (10:32 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 May 2023 19:14:49 +0000 (19:14 +0000)
Move initialization for mirror_end variable in
llapi_mirror_resync_many(), otherwise lfs mirror resync
may fail since mirror_end gets reset on each pass of
the loop.

Fixes: b0297a1056 ("LU-16518 lnet: fix clang build errors")
Test-Parameters: testlist=sanity-flr env=ONLY=42,ONLY_REPEAT=100
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I4edc078cd6e30d7a0ad84383b55b63b885a34d4b
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50919
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
lustre/utils/liblustreapi_layout.c

index 10f82be..9bdeb7c 100644 (file)
@@ -2932,6 +2932,7 @@ int llapi_mirror_resync_many(int fd, struct llapi_layout *layout,
        void *buf;
        uint64_t pos = start;
        uint64_t data_off = pos, data_end = pos;
+       uint64_t mirror_end = LUSTRE_EOF;
        uint32_t src = 0;
        int i;
        int rc;
@@ -2942,7 +2943,6 @@ int llapi_mirror_resync_many(int fd, struct llapi_layout *layout,
                return -rc;
 
        while (pos < end) {
-               uint64_t mirror_end = LUSTRE_EOF;
                ssize_t bytes_read;
                size_t to_read;
                size_t to_write;