From a43baf408c9c961b5f51b666f63f2b586b33440c Mon Sep 17 00:00:00 2001 From: Bobi Jam Date: Fri, 16 Apr 2021 23:56:01 +0800 Subject: [PATCH] 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. Lustre-change: https://review.whamcloud.com/43345 Lustre-commit: 1a5169f9962e254ed4225fe35e8ee6cb6ff7a7f6 Signed-off-by: Bobi Jam Change-Id: Ic4e16f484a0a64c670eea5d47054bac19bc95144 Reviewed-by: John L. Hammond Reviewed-by: Andreas Dilger Reviewed-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/44245 Tested-by: jenkins Tested-by: Maloo --- lustre/lov/lov_lock.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lustre/lov/lov_lock.c b/lustre/lov/lov_lock.c index 1b4a958..abc561e 100644 --- a/lustre/lov/lov_lock.c +++ b/lustre/lov/lov_lock.c @@ -201,6 +201,8 @@ init_sublock: lls->sub_initialized = 1; nr++; } + if (result < 0) + break; } LASSERT(ergo(result == 0, nr == lovlck->lls_nr)); -- 1.8.3.1