diff mbox

CIFS: Fix missing a decrement of inFlight value

Message ID 1312398738-14346-1-git-send-email-piastryyy@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Pavel Shilovsky Aug. 3, 2011, 7:12 p.m. UTC
if we failed on getting mid entry in cifs_call_async.

Cc: stable@kernel.org
Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
---
 fs/cifs/transport.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

Comments

Jeff Layton Aug. 3, 2011, 8:14 p.m. UTC | #1
On Wed,  3 Aug 2011 23:12:18 +0400
Pavel Shilovsky <piastryyy@gmail.com> wrote:

> if we failed on getting mid entry in cifs_call_async.
> 
> Cc: stable@kernel.org
> Signed-off-by: Pavel Shilovsky <piastryyy@gmail.com>
> ---
>  fs/cifs/transport.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
> index 147aa22..c1b9c4b 100644
> --- a/fs/cifs/transport.c
> +++ b/fs/cifs/transport.c
> @@ -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:

Reviewed-by: Jeff Layton <jlayton@redhat.com>
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c
index 147aa22..c1b9c4b 100644
--- a/fs/cifs/transport.c
+++ b/fs/cifs/transport.c
@@ -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;
 	}