Re: [PATCH 44/44] net/mptcp: Change some dubious min_t(int, ...) to min()
From: Matthieu Baerts
Date: Thu Dec 18 2025 - 12:33:32 EST
Hi David,
On 19/11/2025 23:41, david.laight.linux@xxxxxxxxx wrote:
> From: David Laight <david.laight.linux@xxxxxxxxx>
>
> There are two:
> min_t(int, xxx, mptcp_wnd_end(msk) - msk->snd_nxt);
> Both mptcp_wnd_end(msk) and msk->snd_nxt are u64, their difference
> (aka the window size) might be limited to 32 bits - but that isn't
> knowable from this code.
> So checks being added to min_t() detect the potential discard of
> significant bits.
>
> Provided the 'avail_size' and return of mptcp_check_allowed_size()
> are changed to an unsigned type (size_t matches the type the caller
> uses) both min_t() can be changed to min().
Thank you for the patch!
Reviewed-by: Matthieu Baerts (NGI0) <matttbe@xxxxxxxxxx>
I'm not sure what the status on your side: I don't know if you still
plan to send a specific series for all the modifications in the net, but
just in case, I just applied your patch in the MPTCP tree. I removed the
"net/" prefix from the subject. I will send this patch with others for
including in the net-next tree later on if you didn't do that in between.
Cheers,
Matt
--
Sponsored by the NGI0 Core fund.