cifs: add a warning when the in-flight count goes negative 5.15-backport-6-15-23
authorSteve French <stfrench@microsoft.com>
Fri, 16 Jun 2023 01:31:23 +0000 (20:31 -0500)
committerSteve French <stfrench@microsoft.com>
Fri, 16 Jun 2023 01:39:00 +0000 (20:39 -0500)
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>
fs/cifs/smb2ops.c

index 9b42028e08b626eddc59c12d0bf667d276cd3744..221c6b1ee3775ae56cad9b425ce6c69ee41a15b3 100644 (file)
@@ -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) &&