The functions to initialize the coordinator and its proc entries
were called in the same order as the cleanup ones.
This patch reorders the cleanup functions called in mdt_fini()
according to the error path of mdt_init0().
Signed-off-by: Quentin Bouget <quentin.bouget.ocre@cea.fr>
Change-Id: Ic242b8f02cf44f900541446964297982ad6fc178
Reviewed-on: https://review.whamcloud.com/21207
Tested-by: Jenkins
Tested-by: Maloo <hpdd-maloo@intel.com>
Reviewed-by: Henri Doreau <henri.doreau@cea.fr>
Reviewed-by: Frank Zago <fzago@cray.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
{
static void mdt_fini(const struct lu_env *env, struct mdt_device *m)
{
- struct md_device *next = m->mdt_child;
- struct lu_device *d = &m->mdt_lu_dev;
- struct obd_device *obd = mdt2obd_dev(m);
- struct lfsck_stop stop;
- ENTRY;
+ struct md_device *next = m->mdt_child;
+ struct lu_device *d = &m->mdt_lu_dev;
+ struct obd_device *obd = mdt2obd_dev(m);
+ struct lfsck_stop stop;
stop.ls_status = LS_PAUSED;
stop.ls_flags = 0;
next->md_ops->mdo_iocontrol(env, next, OBD_IOC_STOP_LFSCK, 0, &stop);
stop.ls_status = LS_PAUSED;
stop.ls_flags = 0;
next->md_ops->mdo_iocontrol(env, next, OBD_IOC_STOP_LFSCK, 0, &stop);
if (m->mdt_opts.mo_coordinator)
mdt_hsm_cdt_stop(m);
if (m->mdt_opts.mo_coordinator)
mdt_hsm_cdt_stop(m);
mdt_llog_ctxt_unclone(env, m, LLOG_AGENT_ORIG_CTXT);
mdt_llog_ctxt_unclone(env, m, LLOG_AGENT_ORIG_CTXT);
- mdt_llog_ctxt_unclone(env, m, LLOG_CHANGELOG_ORIG_CTXT);
+ mdt_llog_ctxt_unclone(env, m, LLOG_CHANGELOG_ORIG_CTXT);
if (m->mdt_namespace != NULL)
ldlm_namespace_free_prior(m->mdt_namespace, NULL,
d->ld_obd->obd_force);
if (m->mdt_namespace != NULL)
ldlm_namespace_free_prior(m->mdt_namespace, NULL,
d->ld_obd->obd_force);
- obd_exports_barrier(obd);
- obd_zombie_barrier();
+ obd_exports_barrier(obd);
+ obd_zombie_barrier();
+
+ mdt_quota_fini(env, m);
+
+ cfs_free_nidlist(&m->mdt_squash.rsi_nosquash_nids);
+
+ /* Calling the cleanup functions in the same order as in the mdt_init0
+ * error path
+ */
+ mdt_procfs_fini(m);
+
+ target_recovery_fini(obd);
+ upcall_cache_cleanup(m->mdt_identity_cache);
+ m->mdt_identity_cache = NULL;
+ mdt_fs_cleanup(env, m);
+
+ tgt_fini(env, &m->mdt_lut);
- tgt_fini(env, &m->mdt_lut);
- mdt_fs_cleanup(env, m);
- upcall_cache_cleanup(m->mdt_identity_cache);
- m->mdt_identity_cache = NULL;
if (m->mdt_namespace != NULL) {
ldlm_namespace_free_post(m->mdt_namespace);
if (m->mdt_namespace != NULL) {
ldlm_namespace_free_post(m->mdt_namespace);
- mdt_quota_fini(env, m);
-
- cfs_free_nidlist(&m->mdt_squash.rsi_nosquash_nids);
- mdt_seq_fini(env, m);
- mdt_fld_fini(env, m);