From: Mr NeilBrown Date: Thu, 6 May 2021 00:19:30 +0000 (+1000) Subject: LU-12678 o2iblnd: fix bug in list_first_entry() change. X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=55bc4d0f1b5cff10402f85961866466804bb5c1a;p=fs%2Flustre-release.git LU-12678 o2iblnd: fix bug in list_first_entry() change. This comparison should be != NULL, else a NULL pointer could be dereferenced. Lustre-change: https://review.whamcloud.com/43558 Lustre-commit: 0024460d797490ae90a2221cb5d4648c9d4fac82 Test-Parameters: trivial Fixes: 34b57a6f8fcd ("LU-12678 lnet: use list_first_entry() in lnet/klnds subdirectory.") Signed-off-by: Mr NeilBrown Change-Id: I4510e2e0f2eb7b5bf86626e5ddb5ee537d3fae02 Reviewed-on: https://review.whamcloud.com/48245 Reviewed-by: Andreas Dilger Tested-by: Andreas Dilger --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 52d9b8c..fc31ba1 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -2039,7 +2039,7 @@ kiblnd_fail_poolset(struct kib_poolset *ps, struct list_head *zombies) spin_lock(&ps->ps_lock); while ((po = list_first_entry_or_null(&ps->ps_pool_list, struct kib_pool, - po_list)) == NULL) { + po_list)) != NULL) { po->po_failed = 1; if (po->po_allocated == 0) list_move(&po->po_list, zombies);