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>