Commit 2e5700bd authored by Ronnie Sahlberg's avatar Ronnie Sahlberg Committed by Steve French

smb3: add credits we receive from oplock/break PDUs

Otherwise we gradually leak credits leading to potential
hung session.
Signed-off-by: default avatarRonnie Sahlberg <lsahlber@redhat.com>
CC: Stable <stable@vger.kernel.org>
Reviewed-by: default avatarPavel Shilovsky <pshilov@microsoft.com>
Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
parent 6a9cbdd1
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment