From: Timothy Day Date: Fri, 28 Jul 2023 05:11:49 +0000 (+0000) Subject: LU-17000 lod: fix lod_gen_component_id not wrapping X-Git-Tag: 2.15.58~118 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ce05a43ca0df8bb725dad2ba854ec7bd0a8eae5f;p=fs%2Flustre-release.git LU-17000 lod: fix lod_gen_component_id not wrapping 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 Change-Id: I1bd06b38314686f3d5a1c9ad42b38ad197f1a4e7 Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/51795 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Arshad Hussain Reviewed-by: Oleg Drokin --- diff --git a/lustre/lod/lod_object.c b/lustre/lod/lod_object.c index ae0499f..8a144e0 100644 --- a/lustre/lod/lod_object.c +++ b/lustre/lod/lod_object.c @@ -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; }