From: Bobi Jam Date: Fri, 16 Apr 2021 15:56:01 +0000 (+0800) Subject: LU-14618 lov: correctly handling sub-lock init failure X-Git-Tag: 2.14.52~96 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=1a5169f9962e254ed4225fe35e8ee6cb6ff7a7f6;p=fs%2Flustre-release.git LU-14618 lov: correctly handling sub-lock init failure In lov_lock_sub_init(), if a sublock initialization fails, it needs to bail out of the outer loop as well as the inner one. Signed-off-by: Bobi Jam Change-Id: Ic4e16f484a0a64c670eea5d47054bac19bc95144 Reviewed-on: https://review.whamcloud.com/43345 Tested-by: jenkins Reviewed-by: John L. Hammond Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Reviewed-by: Oleg Drokin --- diff --git a/lustre/lov/lov_lock.c b/lustre/lov/lov_lock.c index 0676522..93d0fbf 100644 --- a/lustre/lov/lov_lock.c +++ b/lustre/lov/lov_lock.c @@ -200,6 +200,8 @@ init_sublock: lls->sub_initialized = 1; nr++; } + if (result < 0) + break; } LASSERT(ergo(result == 0, nr == lovlck->lls_nr));