From: Alex Zhuravlev Date: Wed, 11 Nov 2020 08:00:23 +0000 (+0300) Subject: LU-14132 lod: do not initialize sub llogs twice X-Git-Tag: 2.14.52~181 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F05%2F40605%2F12;p=fs%2Flustre-release.git LU-14132 lod: do not initialize sub llogs twice this can happen during MDT re-activation and then result in leaked objects: lod_device_free()) ASSERTION( atomic_read(&lu->ld_ref) == 0 ) Signed-off-by: Alex Zhuravlev Change-Id: I0afb335ffb20532f9171dd2e514100b12f4d9a76 Reviewed-on: https://review.whamcloud.com/40605 Reviewed-by: Andreas Dilger Reviewed-by: Mike Pershin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/lod/lod_sub_object.c b/lustre/lod/lod_sub_object.c index e2eb8d7..3e8d822 100644 --- a/lustre/lod/lod_sub_object.c +++ b/lustre/lod/lod_sub_object.c @@ -936,6 +936,12 @@ int lod_sub_prep_llog(const struct lu_env *env, struct lod_device *lod, obd = dt->dd_lu_dev.ld_obd; ctxt = llog_get_context(obd, LLOG_UPDATELOG_ORIG_CTXT); LASSERT(ctxt != NULL); + /* concurrent config processing (e.g. setting MDT active) + * can try to initialize llog again before causing double + * initialization. check for this */ + if (ctxt->loc_handle) + GOTO(out_put, rc = 0); + ctxt->loc_flags |= LLOG_CTXT_FLAG_NORMAL_FID; ctxt->loc_chunk_size = LLOG_MIN_CHUNK_SIZE * 4; if (likely(logid_id(&cid->lci_logid) != 0)) {