From e32123d1f92a032cd80169da231989e106173cd4 Mon Sep 17 00:00:00 2001 From: Mikhail Pershin Date: Fri, 13 Aug 2010 08:58:44 +0400 Subject: [PATCH] b=15936 recovery fixes Use only target_recovery_fini() to finish recovery. i=rread --- lustre/include/lustre_lib.h | 3 --- lustre/ldlm/ldlm_lib.c | 20 ++++++++++---------- lustre/ldlm/ldlm_lockd.c | 3 --- lustre/mdt/mdt_handler.c | 2 +- lustre/obdfilter/filter.c | 2 +- lustre/ost/ost_handler.c | 7 +------ 6 files changed, 13 insertions(+), 24 deletions(-) diff --git a/lustre/include/lustre_lib.h b/lustre/include/lustre_lib.h index 02cc979..1af68a6 100644 --- a/lustre/include/lustre_lib.h +++ b/lustre/include/lustre_lib.h @@ -92,9 +92,6 @@ int target_handle_dqacq_callback(struct ptlrpc_request *req); #define OBD_RECOVERY_MAX_TIME (obd_timeout * 18) /* b13079 */ -void target_cancel_recovery_timer(struct obd_device *obd); -void target_stop_recovery_thread(struct obd_device *obd); -void target_cleanup_recovery(struct obd_device *obd); int target_queue_recovery_request(struct ptlrpc_request *req, struct obd_device *obd); void target_send_reply(struct ptlrpc_request *req, int rc, int fail_id); diff --git a/lustre/ldlm/ldlm_lib.c b/lustre/ldlm/ldlm_lib.c index f1dbcd2..ad7a4ef 100644 --- a/lustre/ldlm/ldlm_lib.c +++ b/lustre/ldlm/ldlm_lib.c @@ -1254,7 +1254,13 @@ static void abort_lock_replay_queue(struct obd_device *obd) target_request_copy_put(req); } } -#endif + +/* obd_processing_task_lock should be held */ +static void target_cancel_recovery_timer(struct obd_device *obd) +{ + CDEBUG(D_HA, "%s: cancel recovery timer\n", obd->obd_name); + cfs_timer_disarm(&obd->obd_recovery_timer); +} /* Called from a cleanup function if the device is being cleaned up forcefully. The exports should all have been disconnected already, @@ -1265,7 +1271,7 @@ static void abort_lock_replay_queue(struct obd_device *obd) Because the obd_stopping flag is set, no new requests should be received. */ -void target_cleanup_recovery(struct obd_device *obd) +static void target_cleanup_recovery(struct obd_device *obd) { struct ptlrpc_request *req, *n; cfs_list_t clean_list; @@ -1302,13 +1308,7 @@ void target_cleanup_recovery(struct obd_device *obd) EXIT; } - -/* obd_processing_task_lock should be held */ -void target_cancel_recovery_timer(struct obd_device *obd) -{ - CDEBUG(D_HA, "%s: cancel recovery timer\n", obd->obd_name); - cfs_timer_disarm(&obd->obd_recovery_timer); -} +#endif /* extend = 1 means require at least "duration" seconds left in the timer, extend = 0 means set the total duration (start_recovery_timer) */ @@ -1840,7 +1840,7 @@ static int target_start_recovery_thread(struct lu_target *lut, return rc; } -void target_stop_recovery_thread(struct obd_device *obd) +static void target_stop_recovery_thread(struct obd_device *obd) { cfs_spin_lock_bh(&obd->obd_processing_task_lock); if (obd->obd_recovery_data.trd_processing_task > 0) { diff --git a/lustre/ldlm/ldlm_lockd.c b/lustre/ldlm/ldlm_lockd.c index 81075ee..bded12b 100644 --- a/lustre/ldlm/ldlm_lockd.c +++ b/lustre/ldlm/ldlm_lockd.c @@ -2699,11 +2699,8 @@ EXPORT_SYMBOL(client_obd_cleanup); EXPORT_SYMBOL(client_connect_import); EXPORT_SYMBOL(client_disconnect_export); EXPORT_SYMBOL(server_disconnect_export); -EXPORT_SYMBOL(target_stop_recovery_thread); EXPORT_SYMBOL(target_handle_connect); -EXPORT_SYMBOL(target_cleanup_recovery); EXPORT_SYMBOL(target_destroy_export); -EXPORT_SYMBOL(target_cancel_recovery_timer); EXPORT_SYMBOL(target_send_reply); EXPORT_SYMBOL(target_queue_recovery_request); EXPORT_SYMBOL(target_handle_ping); diff --git a/lustre/mdt/mdt_handler.c b/lustre/mdt/mdt_handler.c index aec469b..5ce7b7d 100644 --- a/lustre/mdt/mdt_handler.c +++ b/lustre/mdt/mdt_handler.c @@ -5499,7 +5499,7 @@ static int mdt_iocontrol(unsigned int cmd, struct obd_export *exp, int len, break; case OBD_IOC_ABORT_RECOVERY: CERROR("Aborting recovery for device %s\n", obd->obd_name); - target_stop_recovery_thread(obd); + target_recovery_fini(obd); rc = 0; break; case OBD_IOC_CHANGELOG_REG: diff --git a/lustre/obdfilter/filter.c b/lustre/obdfilter/filter.c index a731840..83453db 100644 --- a/lustre/obdfilter/filter.c +++ b/lustre/obdfilter/filter.c @@ -4474,7 +4474,7 @@ int filter_iocontrol(unsigned int cmd, struct obd_export *exp, switch (cmd) { case OBD_IOC_ABORT_RECOVERY: { LCONSOLE_WARN("%s: Aborting recovery.\n", obd->obd_name); - target_stop_recovery_thread(obd); + target_recovery_fini(obd); RETURN(0); } diff --git a/lustre/ost/ost_handler.c b/lustre/ost/ost_handler.c index b549391..e0ccbb4 100644 --- a/lustre/ost/ost_handler.c +++ b/lustre/ost/ost_handler.c @@ -2622,12 +2622,7 @@ static int ost_cleanup(struct obd_device *obd) ping_evictor_stop(); - cfs_spin_lock_bh(&obd->obd_processing_task_lock); - if (obd->obd_recovering) { - target_cancel_recovery_timer(obd); - obd->obd_recovering = 0; - } - cfs_spin_unlock_bh(&obd->obd_processing_task_lock); + LASSERT(obd->obd_recovering == 0); cfs_down(&ost->ost_health_sem); ptlrpc_unregister_service(ost->ost_service); -- 1.8.3.1