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-Url: http://git.maquefel.me/?a=commitdiff_plain;h=e4645cc2f1e2d6f268bb8dcfac40997c52432aed;p=linux.git cifs: add a warning when the in-flight count goes negative 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 --- diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c index bbb19bbb14c9d..a8bb9d00d33ad 100644 --- a/fs/smb/client/smb2ops.c +++ b/fs/smb/client/smb2ops.c @@ -93,6 +93,7 @@ smb2_add_credits(struct TCP_Server_Info *server, server->conn_id, server->hostname, *val, add, server->in_flight); } + WARN_ON_ONCE(server->in_flight == 0); server->in_flight--; if (server->in_flight == 0 && ((optype & CIFS_OP_MASK) != CIFS_NEG_OP) &&