]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
cifs: add a warning when the in-flight count goes negative
authorShyam Prasad N <sprasad@microsoft.com>
Fri, 9 Jun 2023 17:46:56 +0000 (17:46 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Sep 2023 08:46:54 +0000 (10:46 +0200)
[ 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 <sprasad@microsoft.com>
Reviewed-by: Bharath SM <bharathsm@microsoft.com>
Signed-off-by: Steve French <stfrench@microsoft.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/cifs/smb2ops.c

index dec306a3b0f4144c8a51a2d01404c525bc9e272b..3287795c648e51ab2f702563f4b0b4ed0e104f53 100644 (file)
@@ -78,6 +78,7 @@ smb2_add_credits(struct TCP_Server_Info *server, const unsigned int add,
                *val = 65000; /* Don't get near 64K credits, avoid srv bugs */
                printk_once(KERN_WARNING "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)
                rc = change_conf(server);