From 1a5169f9962e254ed4225fe35e8ee6cb6ff7a7f6 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. 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 --- 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 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)); -- 1.8.3.1