Whamcloud - gitweb
LU-18045 mdt: do extra MDT cleanup before barrier 91/55791/3
authorMikhail Pershin <mpershin@whamcloud.com>
Thu, 11 Jul 2024 16:48:40 +0000 (19:48 +0300)
committerOleg Drokin <green@whamcloud.com>
Wed, 31 Jul 2024 15:55:58 +0000 (15:55 +0000)
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 <mpershin@whamcloud.com>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/55791
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: Alex Zhuravlev <bzzz@whamcloud.com>
Reviewed-by: Alexander Boyko <alexander.boyko@hpe.com>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
lustre/mdt/mdt_handler.c
lustre/osp/osp_dev.c

index baeadcf..7767191 100644 (file)
@@ -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;
 
index d7ed568..f36f015 100644 (file)
@@ -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.) */