Whamcloud - gitweb
LU-18167 nodemap: Fix return value of range_search/find 37/56137/4
authorChris Horn <chris.horn@hpe.com>
Fri, 23 Aug 2024 17:40:17 +0000 (11:40 -0600)
committerOleg Drokin <green@whamcloud.com>
Fri, 30 Aug 2024 05:58:08 +0000 (05:58 +0000)
commitca6c874da9ff2e27f98e151a816818970af8b342
tree6894cf7309dc428bd7261a66fec13fc868efbace
parent6c5408f61d64ee27ded51436c73aed22c750e140
LU-18167 nodemap: Fix return value of range_search/find

The 'range = NULL' assignments in range_search() and range_find() are
no-ops because the list_for_each_entry_safe macro will set range to
some non-NULL value before the loop exits. Thus, range_search() and
range_find() can return a non-NULL value even when it doesn't match
the NID we are searching for.

Modify the loops to return range immediately upon finding a match.

Test-Parameters: trivial
Test-Parameters: testlist=sanity-sec env=ONLY=16,LOAD_MODULES_REMOTE=true,FORCE_LARGE_NID=true
Fixes: 0ea23e0194 ("LU-13307 nodemap: have nodemap_add_member support large NIDs")
Signed-off-by: Chris Horn <chris.horn@hpe.com>
Change-Id: Id00a2b73da127afaf94d1ecf5d1ef0080d11c6fd
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/56137
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Sebastien Buisson <sbuisson@ddn.com>
lustre/ptlrpc/nodemap_range.c