From 0c364cf6f70818863ac08045470abe858af37839 Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Tue, 19 Nov 2024 18:30:25 +0300 Subject: [PATCH] LU-18460 lod: avoid double llog initialization lod should not try to initialize llogs if they have been initialized already. this may happen if, for example, deactivation of specific MDT has been lost and we activate already active MDT. the result would be an assertion in lod_sub_prep_llog(): LustreError: 8141:0:(lod_sub_object.c:991:lod_sub_prep_llog()) ASSERTION( !ctxt->loc_handle ) failed: Signed-off-by: Alex Zhuravlev Change-Id: I17ed1a19ac143d1dd80e5c711c08311c49eda89e Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/57071 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: Mikhail Pershin Reviewed-by: Oleg Drokin --- lustre/lod/lod_dev.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lustre/lod/lod_dev.c b/lustre/lod/lod_dev.c index 4d0cf09..160f05d 100644 --- a/lustre/lod/lod_dev.c +++ b/lustre/lod/lod_dev.c @@ -1069,7 +1069,7 @@ static int lod_process_config(const struct lu_env *env, *ptr = '.'; tmp = strstr(param, "="); tmp++; - if (*tmp == '1') { + if (*tmp == '1' && sub_tgt->ltd_active == 0) { struct llog_ctxt *ctxt; obd = sub_tgt->ltd_tgt->dd_lu_dev.ld_obd; @@ -1088,7 +1088,7 @@ static int lod_process_config(const struct lu_env *env, sub_tgt->ltd_tgt, sub_tgt->ltd_index); sub_tgt->ltd_active = !rc; - } else { + } else if (*tmp == '0' && sub_tgt->ltd_active != 0) { lod_sub_fini_llog(env, sub_tgt->ltd_tgt, NULL); sub_tgt->ltd_active = 0; -- 1.8.3.1