@@ -2584,7 +2584,6 @@ static int mdc_precleanup(struct obd_device *obd)
obd_cleanup_client_import(obd);
ptlrpc_lprocfs_unregister_obd(obd);
- lprocfs_obd_cleanup(obd);
ldebugfs_free_md_stats(obd);
mdc_llog_finish(obd);
return 0;
@@ -3070,7 +3070,6 @@ static int osc_precleanup(struct obd_device *obd)
osc_precleanup_common(obd);
ptlrpc_lprocfs_unregister_obd(obd);
- lprocfs_obd_cleanup(obd);
return 0;
}
@@ -1172,6 +1172,10 @@ void ptlrpc_lprocfs_unregister_service(struct ptlrpc_service *svc)
void ptlrpc_lprocfs_unregister_obd(struct obd_device *obd)
{
+ /* cleanup first to allow concurrent access to device's
+ * stats via debugfs to complete safely
+ */
+ lprocfs_obd_cleanup(obd);
debugfs_remove_recursive(obd->obd_svc_debugfs_entry);
if (obd->obd_svc_stats)