diff options
author | Steve French <stfrench@microsoft.com> | 2018-09-01 01:10:17 -0500 |
---|---|---|
committer | Steve French <stfrench@microsoft.com> | 2018-10-23 21:16:03 -0500 |
commit | b340a4d4aa18691a6d8b0e747840b0cf30dc01cb (patch) | |
tree | 577331ff750f0298ee279b24f1ec7c94e213d7d5 /fs/cifs/smb2ops.c | |
parent | ce7fb50f92d78cf9cd35a520d293a4b791c8d7a1 (diff) | |
download | linux-stable-b340a4d4aa18691a6d8b0e747840b0cf30dc01cb.tar.gz linux-stable-b340a4d4aa18691a6d8b0e747840b0cf30dc01cb.tar.bz2 linux-stable-b340a4d4aa18691a6d8b0e747840b0cf30dc01cb.zip |
smb3: add tracepoint to catch cases where credit refund of failed op overlaps reconnect
Add tracepoint to catch potential cases where a pending operation overlapping a
reconnect could fail and incorrectly refund its credits causing the client
to think it has more credits available than the server thinks it does.
Signed-off-by: Steve French <stfrench@microsoft.com>
Reviewed-by: Ronnie Sahlberg <lsahlber@redhat.com>
Diffstat (limited to 'fs/cifs/smb2ops.c')
-rw-r--r-- | fs/cifs/smb2ops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 89985a0a6819..831fa60ef886 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -74,6 +74,12 @@ smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add, int *val, rc = 0; spin_lock(&server->req_lock); val = server->ops->get_credits_field(server, optype); + + /* eg found case where write overlapping reconnect messed up credits */ + if (((optype & CIFS_OP_MASK) == CIFS_NEG_OP) && (*val != 0)) + trace_smb3_reconnect_with_invalid_credits(server->CurrentMid, + server->hostname, *val); + *val += add; if (*val > 65000) { *val = 65000; /* Don't get near 64K credits, avoid srv bugs */ |