Whamcloud - gitweb
LU-17000 lod: fix lod_gen_component_id not wrapping 95/51795/6
authorTimothy Day <timday@amazon.com>
Fri, 28 Jul 2023 05:11:49 +0000 (05:11 +0000)
committerOleg Drokin <green@whamcloud.com>
Mon, 7 Aug 2023 03:50:55 +0000 (03:50 +0000)
The end variable is set to SEQ_ID_MAX. The code
for checking whether to try and search the
remaining ids checks LCME_ID_MAX. Thus, it
never gets called. Change the check to look for
SEQ_ID_MAX. Also, change the start and end such
that all ids are checked once.

Addresses-Coverity-ID: 397902 ("Logically dead code")

Test-Parameters: trivial
Signed-off-by: Timothy Day <timday@amazon.com>
Change-Id: I1bd06b38314686f3d5a1c9ad42b38ad197f1a4e7
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51795
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Arshad Hussain <arshad.hussain@aeoncomputing.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
lustre/lod/lod_object.c

index ae0499f..8a144e0 100644 (file)
@@ -6288,10 +6288,10 @@ again:
                if (i == lo->ldo_comp_cnt)
                        RETURN(pflr_id(mirror_id, id));
        }
-       if (end == LCME_ID_MAX) {
+
+       if (end == SEQ_ID_MAX) {
+               end = min_t(__u32, start, SEQ_ID_MAX) - 1;
                start = 1;
-               end = min(lo->ldo_layout_gen & LCME_ID_MASK,
-                         (__u32)(LCME_ID_MAX - 1));
                goto again;
        }