From: Alex Zhuravlev Date: Tue, 12 Nov 2019 17:45:50 +0000 (+0300) Subject: LU-12961 mdd: avoid double call to mdd_changelog_fini() X-Git-Tag: 2.14.51~154 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=refs%2Fchanges%2F37%2F36737%2F11;p=fs%2Flustre-release.git LU-12961 mdd: avoid double call to mdd_changelog_fini() the first call is done from mdd_prepare() as part of error handling, another call is done from mdd_device_shutdown(). in the similar cases fini routines checks whether the state is initialized. e.g. mdd_orphan_index_fini() releases the object and sets mdd_orphans to NULL, then all subsequent calls to mdd_orphan_index_fini() return immediately. mdd_changelog_fini() can't do this way, so the excplicit state has been introduced. Change-Id: Ifd21569e68c836f44bb59adea4e8fed6ccef1c7b Signed-off-by: Alex Zhuravlev Reviewed-on: https://review.whamcloud.com/36737 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Andreas Dilger Reviewed-by: John L. Hammond --- diff --git a/lustre/mdd/mdd_device.c b/lustre/mdd/mdd_device.c index cd03553..14d812a 100644 --- a/lustre/mdd/mdd_device.c +++ b/lustre/mdd/mdd_device.c @@ -598,7 +598,9 @@ static void mdd_changelog_fini(const struct lu_env *env, struct obd_device *obd = mdd2obd_dev(mdd); struct llog_ctxt *ctxt; - mdd->mdd_cl.mc_flags = 0; + if (mdd->mdd_cl.mc_flags & CLM_CLEANUP_DONE) + return; + mdd->mdd_cl.mc_flags = CLM_CLEANUP_DONE; again: /* stop GC-thread if running */ diff --git a/lustre/mdd/mdd_internal.h b/lustre/mdd/mdd_internal.h index aa7016e..b06c021 100644 --- a/lustre/mdd/mdd_internal.h +++ b/lustre/mdd/mdd_internal.h @@ -80,6 +80,8 @@ #define CLM_FINI 0x20000 /** some changelog records purged */ #define CLM_PURGE 0x40000 +/** changelog cleanup done, to prevent double cleanup */ +#define CLM_CLEANUP_DONE 0x80000 #define LLOG_CHANGELOG_HDR_SZ (sizeof(struct llog_changelog_rec) - \ sizeof(struct changelog_rec))