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 <bzzz@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/36737
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: John L. Hammond <jhammond@whamcloud.com>
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 */
#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))