From 3d101645a52d7ffa6a5d45c373e02761cebb09fd Mon Sep 17 00:00:00 2001 From: Alex Zhuravlev Date: Wed, 11 Nov 2020 11:00:23 +0300 Subject: [PATCH] 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 --- lustre/lod/lod_sub_object.c | 6 ++++++ 1 file changed, 6 insertions(+) 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)) { -- 1.8.3.1