Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Tom Talpey <tom@talpey.com>
To: Shyam Prasad N <nspmangalore@gmail.com>
Cc: Steve French <smfrench@gmail.com>,
	linux-cifs@vger.kernel.org, pc@cjr.nz, bharathsm.hsk@gmail.com,
	Shyam Prasad N <sprasad@microsoft.com>
Subject: Re: [PATCH 3/6] cifs: add a warning when the in-flight count goes negative
Date: Tue, 27 Jun 2023 15:40:28 -0400	[thread overview]
Message-ID: <10914d74-e302-2430-8497-8532fae0348f@talpey.com> (raw)
In-Reply-To: <CANT5p=p62mGd8uwgNEHeAa9pEnC0TcJSx-pXDCwzFSCaX16O5g@mail.gmail.com>

On 6/26/2023 2:33 AM, Shyam Prasad N wrote:
> On Fri, Jun 23, 2023 at 9:52 PM Tom Talpey <tom@talpey.com> wrote:
>>
>> On 6/11/2023 4:01 AM, Shyam Prasad N wrote:
>>> On Sun, Jun 11, 2023 at 1:19 AM Steve French <smfrench@gmail.com> wrote:
>>>>
>>>> should this be a warn once? Could it get very noisy?
>>>>
>>>> On Fri, Jun 9, 2023 at 12:47 PM Shyam Prasad N <nspmangalore@gmail.com> wrote:
>>>>>
>>>>> 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>
>>>>> ---
>>>>>    fs/smb/client/smb2ops.c | 1 +
>>>>>    1 file changed, 1 insertion(+)
>>>>>
>>>>> diff --git a/fs/smb/client/smb2ops.c b/fs/smb/client/smb2ops.c
>>>>> index 6e3be58cfe49..43162915e03c 100644
>>>>> --- a/fs/smb/client/smb2ops.c
>>>>> +++ b/fs/smb/client/smb2ops.c
>>>>> @@ -91,6 +91,7 @@ smb2_add_credits(struct TCP_Server_Info *server,
>>>>>                                               server->conn_id, server->hostname, *val,
>>>>>                                               add, server->in_flight);
>>>>>           }
>>>>> +       WARN_ON(server->in_flight == 0);
>>>>>           server->in_flight--;
>>>>>           if (server->in_flight == 0 &&
>>>>>              ((optype & CIFS_OP_MASK) != CIFS_NEG_OP) &&
>>>>> --
>>>>> 2.34.1
>>>>>
>>>>
>>>>
>>>> --
>>>> Thanks,
>>>>
>>>> Steve
>>>
>>> Makes sense. We can have a warn once.
>>
>> Which sounds great, but isn't this connection basically toast?
>> It's not super helpful to just whine. Why not clamp it at zero?
>>
>> Tom.
> 
> So there's no "legal" way that this count can go negative.
> If it has, that's definitely because there's a bug. The WARN will
> hopefully help us catch and fix the bug.

To be clear, I'm ok with the warn, it's the fact that the code
goes to all the trouble to say it but doesn't do anything to
recover.

> We could also have a clamp at 0. I'll send an updated patch.

Sounds good.

Tom.

  reply	other threads:[~2023-06-27 19:40 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-09 17:46 [PATCH 1/6] cifs: fix status checks in cifs_tree_connect Shyam Prasad N
2023-06-09 17:46 ` [PATCH 2/6] cifs: print all credit counters in DebugData Shyam Prasad N
2023-06-10 19:48   ` Steve French
2023-06-09 17:46 ` [PATCH 3/6] cifs: add a warning when the in-flight count goes negative Shyam Prasad N
2023-06-10 19:49   ` Steve French
2023-06-11  8:01     ` Shyam Prasad N
2023-06-23 16:22       ` Tom Talpey
2023-06-26  6:33         ` Shyam Prasad N
2023-06-27 19:40           ` Tom Talpey [this message]
2023-06-09 17:46 ` [PATCH 4/6] cifs: display the endpoint IP details in DebugData Shyam Prasad N
2023-06-09 18:02   ` Enzo Matsumiya
2023-06-11  8:02     ` Shyam Prasad N
2023-06-12  7:59       ` Shyam Prasad N
2023-06-12  7:59         ` Shyam Prasad N
2023-06-12 14:03           ` Enzo Matsumiya
2023-06-12 13:52         ` Enzo Matsumiya
2023-06-12 15:25         ` Paulo Alcantara
2023-06-12 15:29           ` Enzo Matsumiya
2023-06-23  4:21             ` Shyam Prasad N
2023-06-23 15:51               ` Steve French
2023-06-23 15:54               ` Tom Talpey
2023-06-27 12:17                 ` Shyam Prasad N
2023-06-28 10:20                   ` Shyam Prasad N
2023-06-28 13:39                     ` Tom Talpey
2023-06-28 16:24                       ` Steve French
2023-06-28 16:51                     ` Steve French
2023-06-28 17:07                     ` Steve French
2023-06-28 17:11                     ` Steve French
2023-06-29 15:35                       ` Shyam Prasad N
2023-06-09 17:46 ` [PATCH 5/6] cifs: fix max_credits implementation Shyam Prasad N
2023-06-23 16:00   ` Tom Talpey
2023-06-26  5:40     ` Shyam Prasad N
2023-06-09 17:46 ` [PATCH 6/6] cifs: fix sockaddr comparison in iface_cmp Shyam Prasad N
2023-06-23 16:09   ` Tom Talpey
2023-06-26 11:12     ` Dan Carpenter
2023-06-27 19:37       ` Tom Talpey
2023-06-10 19:45 ` [PATCH 1/6] cifs: fix status checks in cifs_tree_connect Steve French

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=10914d74-e302-2430-8497-8532fae0348f@talpey.com \
    --to=tom@talpey.com \
    --cc=bharathsm.hsk@gmail.com \
    --cc=linux-cifs@vger.kernel.org \
    --cc=nspmangalore@gmail.com \
    --cc=pc@cjr.nz \
    --cc=smfrench@gmail.com \
    --cc=sprasad@microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox