Whamcloud - gitweb
b=15936 recovery fixes
authorMikhail Pershin <tappro@sun.com>
Fri, 13 Aug 2010 04:58:44 +0000 (08:58 +0400)
committerMikhail Pershin <tappro@sun.com>
Fri, 13 Aug 2010 06:45:04 +0000 (10:45 +0400)
Use only target_recovery_fini() to finish recovery.

i=rread

lustre/include/lustre_lib.h
lustre/ldlm/ldlm_lib.c
lustre/ldlm/ldlm_lockd.c
lustre/mdt/mdt_handler.c
lustre/obdfilter/filter.c
lustre/ost/ost_handler.c

index 02cc979..1af68a6 100644 (file)
@@ -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);
index f1dbcd2..ad7a4ef 100644 (file)
@@ -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) {
index 81075ee..bded12b 100644 (file)
@@ -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);
index aec469b..5ce7b7d 100644 (file)
@@ -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:
index a731840..83453db 100644 (file)
@@ -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);
         }
 
index b549391..e0ccbb4 100644 (file)
@@ -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);