Whamcloud - gitweb
LU-11542 import: fix race between imp_state & imp_invalid
[fs/lustre-release.git] / lustre / ptlrpc / client.c
index 0d01b0f..529a6fd 100644 (file)
@@ -3249,14 +3249,14 @@ int ptlrpc_replay_req(struct ptlrpc_request *req)
 void ptlrpc_abort_inflight(struct obd_import *imp)
 {
        struct list_head *tmp, *n;
-
        ENTRY;
+
        /*
         * Make sure that no new requests get processed for this import.
         * ptlrpc_{queue,set}_wait must (and does) hold imp_lock while testing
         * this flag and then putting requests on sending_list or delayed_list.
         */
-       spin_lock(&imp->imp_lock);
+       assert_spin_locked(&imp->imp_lock);
 
        /*
         * XXX locking?  Maybe we should remove each request with the list
@@ -3301,8 +3301,6 @@ void ptlrpc_abort_inflight(struct obd_import *imp)
        if (imp->imp_replayable)
                ptlrpc_free_committed(imp);
 
-       spin_unlock(&imp->imp_lock);
-
        EXIT;
 }