From: Frank Sehr Date: Thu, 1 May 2025 20:19:39 +0000 (-0700) Subject: LU-18966 o2iblnd: Missing spin lock in poolset destroy X-Git-Tag: 2.16.56~64 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F59%2F59059%2F2;p=fs%2Flustre-release.git LU-18966 o2iblnd: Missing spin lock in poolset destroy Put a spin lock around pool set destroy in kiblnd_fini_fmr_poolset() and kiblnd_fini_poolset() Test-Parameters: trivial testlist=sanity-lnet Signed-off-by: Frank Sehr Change-Id: I4a2864a64b1c1389cab84b120f889b1414a5d0de Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/59059 Tested-by: jenkins Tested-by: Maloo Reviewed-by: James Simmons Reviewed-by: Chris Horn Reviewed-by: Timothy Day Reviewed-by: Oleg Drokin --- diff --git a/lnet/klnds/o2iblnd/o2iblnd.c b/lnet/klnds/o2iblnd/o2iblnd.c index 710dd26..6cd6c3db 100644 --- a/lnet/klnds/o2iblnd/o2iblnd.c +++ b/lnet/klnds/o2iblnd/o2iblnd.c @@ -1856,8 +1856,11 @@ static void kiblnd_fini_fmr_poolset(struct kib_fmr_poolset *fps) { if (fps->fps_net != NULL) { /* initialized? */ + /* added spinlock to protect poolset */ + spin_lock(&fps->fps_lock); kiblnd_destroy_fmr_pool_list(&fps->fps_failed_pool_list); kiblnd_destroy_fmr_pool_list(&fps->fps_pool_list); + spin_unlock(&fps->fps_lock); } } @@ -2245,8 +2248,11 @@ static void kiblnd_fini_poolset(struct kib_poolset *ps) { if (ps->ps_net != NULL) { /* initialized? */ + /* added spinlock to protect poolset */ + spin_lock(&ps->ps_lock); kiblnd_destroy_pool_list(&ps->ps_failed_pool_list); kiblnd_destroy_pool_list(&ps->ps_pool_list); + spin_unlock(&ps->ps_lock); } }