From: Alex Zhuravlev Date: Tue, 19 Nov 2024 15:30:25 +0000 (+0300) Subject: LU-18460 lod: avoid double llog initialization X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F71%2F57071%2F4;p=fs%2Flustre-release.git 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 --- 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;