summaryrefslogtreecommitdiffstats
path: root/kernel/fs/cifs/transport.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/fs/cifs/transport.c')
-rw-r--r--kernel/fs/cifs/transport.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/kernel/fs/cifs/transport.c b/kernel/fs/cifs/transport.c
index 126f46b88..87abe8ed0 100644
--- a/kernel/fs/cifs/transport.c
+++ b/kernel/fs/cifs/transport.c
@@ -576,14 +576,16 @@ cifs_call_async(struct TCP_Server_Info *server, struct smb_rqst *rqst,
cifs_in_send_dec(server);
cifs_save_when_sent(mid);
- if (rc < 0)
+ if (rc < 0) {
server->sequence_number -= 2;
+ cifs_delete_mid(mid);
+ }
+
mutex_unlock(&server->srv_mutex);
if (rc == 0)
return 0;
- cifs_delete_mid(mid);
add_credits_and_wake_if(server, credits, optype);
return rc;
}
@@ -644,7 +646,9 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server)
}
spin_unlock(&GlobalMid_Lock);
+ mutex_lock(&server->srv_mutex);
DeleteMidQEntry(mid);
+ mutex_unlock(&server->srv_mutex);
return rc;
}