From: Mikhail Pershin Date: Thu, 11 Jul 2024 16:48:40 +0000 (+0300) Subject: LU-18045 mdt: do extra MDT cleanup before barrier X-Git-Tag: 2.15.65~48 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=ec336c8de30abf4e5f84332ca709c3a5decfc57c;p=fs%2Flustre-release.git LU-18045 mdt: do extra MDT cleanup before barrier In osp_disconnect() do namespace cleanup to don't leave OSP locks pinning obd_export_barrier() In mdt_fini() call target_recovery_fini() and mdt_quota_fini() before calling obd_export_barrier() Fixes: ffedcbae21 ("LU-17809 osp: make disconnect asynchronous") Change-Id: I97bf7915cf8b77e26b2a8f1ba41c6128575bd06b Signed-off-by: Mikhail Pershin Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55791 Reviewed-by: Andreas Dilger Reviewed-by: Alex Zhuravlev Reviewed-by: Alexander Boyko Reviewed-by: Oleg Drokin Tested-by: jenkins Tested-by: Maloo --- diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index baeadcf..7767191 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -6218,24 +6218,21 @@ static void mdt_fini(const struct lu_env *env, struct mdt_device *m) mdt_llog_ctxt_unclone(env, m, LLOG_AGENT_ORIG_CTXT); mdt_llog_ctxt_unclone(env, m, LLOG_CHANGELOG_ORIG_CTXT); - + target_recovery_fini(obd); if (m->mdt_namespace != NULL) ldlm_namespace_free_prior(m->mdt_namespace, NULL, d->ld_obd->obd_force); + mdt_quota_fini(env, m); 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_tunables_fini(m); - - target_recovery_fini(obd); upcall_cache_cleanup(m->mdt_identity_cache); m->mdt_identity_cache = NULL; diff --git a/lustre/osp/osp_dev.c b/lustre/osp/osp_dev.c index d7ed568..f36f015 100644 --- a/lustre/osp/osp_dev.c +++ b/lustre/osp/osp_dev.c @@ -484,6 +484,8 @@ static int osp_disconnect(struct osp_device *d) ptlrpc_deactivate_import(imp); + ldlm_namespace_cleanup(obd->obd_namespace, LDLM_FL_LOCAL_ONLY); + /* Some non-replayable imports (MDS's OSCs) are pinged, so just * delete it regardless. (It's safe to delete an import that was * never added.) */