[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <p6vfujqnba3rxuifaouccuuhonhyupsu554cdnlx45fvboggku@5h7gaicp4opp>
Date: Mon, 20 Oct 2025 11:45:02 -0300
From: Enzo Matsumiya <ematsumiya@...e.de>
To: David Howells <dhowells@...hat.com>
Cc: Steve French <sfrench@...ba.org>, Paulo Alcantara <pc@...guebit.org>,
linux-cifs@...r.kernel.org, linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] cifs: Fix TCP_Server_Info::credits to be signed
On 10/20, David Howells wrote:
>Enzo Matsumiya <ematsumiya@...e.de> wrote:
>
>> Both semantically and technically, credits shouldn't go negative.
>> Shouldn't those other fields/functions become unsigned instead?
>
>That's really a question for Steve, but it makes it easier to handle
>underflow
But if there's an overflow somewhere the math should be checked instead
(I never seen it happen though).
> and I'm guessing that the maximum credits isn't likely to exceed
>2G.
Yes, it's capped at 60-65k (depends on the function...)
So yes, an unsigned short would be fine.
Cheers,
Enzo
Powered by blists - more mailing lists