diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2019-05-01 12:03:41 +1000 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-05-07 23:24:55 -0500 |
commit | d69cb728e70c40268762182a62f5d5d6fa51c5b2 (patch) | |
tree | 875d356df74e9773969aa9dd03adbf78cf6511e3 /fs/cifs/cifssmb.c | |
parent | edf3ef3707c2321afdb4cde3eba756a687f3e8e7 (diff) | |
download | linux-d69cb728e70c40268762182a62f5d5d6fa51c5b2.tar.gz linux-d69cb728e70c40268762182a62f5d5d6fa51c5b2.tar.bz2 linux-d69cb728e70c40268762182a62f5d5d6fa51c5b2.zip |
cifs: fix credits leak for SMB1 oplock breaks
For SMB1 oplock breaks we would grab one credit while sending the PDU
but we would never relese the credit back since we will never receive a
response to this from the server. Eventuallt this would lead to a hang
once all credits are leaked.
Fix this by defining a new flag CIFS_NO_SRV_RSP which indicates that there
is no server response to this command and thus we need to add any credits back
immediately after sending the PDU.
CC: Stable <stable@vger.kernel.org> #v5.0+
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs/cifssmb.c')
-rw-r--r-- | fs/cifs/cifssmb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/cifs/cifssmb.c b/fs/cifs/cifssmb.c index f43747c062a7..6050851edcb8 100644 --- a/fs/cifs/cifssmb.c +++ b/fs/cifs/cifssmb.c @@ -2540,7 +2540,7 @@ CIFSSMBLock(const unsigned int xid, struct cifs_tcon *tcon, if (lockType == LOCKING_ANDX_OPLOCK_RELEASE) { /* no response expected */ - flags = CIFS_ASYNC_OP | CIFS_OBREAK_OP; + flags = CIFS_NO_SRV_RSP | CIFS_ASYNC_OP | CIFS_OBREAK_OP; pSMB->Timeout = 0; } else if (waitFlag) { flags = CIFS_BLOCKING_OP; /* blocking operation, no timeout */ |