Skip to contentSkip to conversation

CIFS: Fix missing a decrement of inFlight value

PATCH In review Pavel Shilovsky 2 participants 2 messages Aug 3, 2011 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CIFS: Fix missing a decrement of inFlight value

if we failed on getting mid entry in cifs_call_async.

---
 fs/cifs/transport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/cifs/transport.c +2 -0
index 147aa22..c1b9c4b 100644
@@ -362,6 +362,8 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
 	mid = AllocMidQEntry(hdr, server);
 	if (mid == NULL) {
 		mutex_unlock(&server->srv_mutex);
+		atomic_dec(&server->inFlight);
+		wake_up(&server->request_q);
 		return -ENOMEM;
 	}
 
Signature · 1 line
1.7.1
Reviewed-by
#2 lore raw
In reply to a message not in the archive
Quoted 13 lines · On Wed, 3 Aug 2011 23:12:18 +0400 Pavel Shilovsky…

if we failed on getting mid entry in cifs_call_async.

---
 fs/cifs/transport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
fs/cifs/transport.c +0 -0
index 147aa22..c1b9c4b 100644

fs/cifs/transport.c cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov, · line 369

Quoted 8 lines
fs/cifs/transport.c +2 -0
@@ -362,6 +362,8 @@ cifs_call_async(struct TCP_Server_Info *server, struct kvec *iov,
 	mid = AllocMidQEntry(hdr, server);
 	if (mid == NULL) {
 		mutex_unlock(&server->srv_mutex);
+		atomic_dec(&server->inFlight);
+		wake_up(&server->request_q);
 		return -ENOMEM;
 	}
 

Good catch -- looks correct: