diff options
author | Ronnie Sahlberg <lsahlber@redhat.com> | 2019-01-23 07:20:38 +0100 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2019-01-24 21:52:06 +0100 |
commit | 2e5700bdde438ed708b36d8acd0398dc73cbf759 (patch) | |
tree | 1c37b59481136a7e680368223f0126d7cce08208 /fs/cifs | |
parent | CIFS: Fix mounts if the client is low on credits (diff) | |
download | linux-2e5700bdde438ed708b36d8acd0398dc73cbf759.tar.xz linux-2e5700bdde438ed708b36d8acd0398dc73cbf759.zip |
smb3: add credits we receive from oplock/break PDUs
Otherwise we gradually leak credits leading to potential
hung session.
Signed-off-by: Ronnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: Pavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Diffstat (limited to 'fs/cifs')
-rw-r--r-- | fs/cifs/smb2misc.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index 6a9c47541c53..7b8b58fb4d3f 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -648,6 +648,13 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) if (rsp->sync_hdr.Command != SMB2_OPLOCK_BREAK) return false; + if (rsp->sync_hdr.CreditRequest) { + spin_lock(&server->req_lock); + server->credits += le16_to_cpu(rsp->sync_hdr.CreditRequest); + spin_unlock(&server->req_lock); + wake_up(&server->request_q); + } + if (rsp->StructureSize != smb2_rsp_struct_sizes[SMB2_OPLOCK_BREAK_HE]) { if (le16_to_cpu(rsp->StructureSize) == 44) |