From: Shyam Prasad N Date: Fri, 9 Jun 2023 17:46:56 +0000 (+0000) Subject: cifs: add a warning when the in-flight count goes negative X-Git-Tag: v5.15.150~47 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=48c63a1744898cb9cf0c79db5173ea2a06235494;p=thirdparty%2Fkernel%2Fstable.git cifs: add a warning when the in-flight count goes negative [ Upstream commit e4645cc2f1e2d6f268bb8dcfac40997c52432aed ] We've seen the in-flight count go into negative with some internal stress testing in Microsoft. Adding a WARN when this happens, in hope of understanding why this happens when it happens. Signed-off-by: Shyam Prasad N Reviewed-by: Bharath SM Signed-off-by: Steve French Signed-off-by: Sasha Levin --- diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index a8f33e8261344..b725bd3144fb7 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -85,6 +85,7 @@ smb2_add_credits(struct TCP_Server_Info *server, *val = 65000; /* Don't get near 64K credits, avoid srv bugs */ pr_warn_once("server overflowed SMB3 credits\n"); } + WARN_ON_ONCE(server->in_flight == 0); server->in_flight--; if (server->in_flight == 0 && ((optype & CIFS_OP_MASK) != CIFS_NEG_OP) &&