]> git.hungrycats.org Git - linux/commit
ksmbd: keep retry timeout clamp bounds constant
authorNamjae Jeon <linkinjeon@kernel.org>
Mon, 26 Oct 2026 06:26:31 +0000 (15:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 6 Nov 2026 17:10:54 +0000 (12:10 -0500)
commitc314b2be197ac9f52189bbcdc5e1c49c1819ad8c
tree7d155a3a1e5bde61ff73ab2fa1288d4bda6a253e
parentb0ce89f6f6ed0285edcaf43729a9b0b71482ac18
ksmbd: keep retry timeout clamp bounds constant

commit 146c3fc6540e24eef6296395a35bf5b924182e8b upstream.

With CONFIG_HZ=1024, msecs_to_jiffies(1200) includes an overflow check
that calls jiffies_to_msecs(MAX_JIFFY_OFFSET). Its saturation branch
returns MAX_JIFFY_OFFSET, which exceeds the six-second upper bound.
GCC 10.5 carries that branch into clamp_t()'s bounds check and fails to
build ksmbd_tcp_writev() on MIPS.

Compute the 1200 ms lower bound with DIV_ROUND_UP() instead, so both
bounds are compile-time constants. The lower bound still rounds up to
the next jiffy, and the retry interval remains between 1.2 and 6 seconds.

Fixes: c0632d2010ff ("ksmbd: track delivery of queued TCP writes")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202610251743.jztr17Ib-lkp@intel.com/
Signed-off-by: Namjae Jeon <linkinjeon@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/smb/server/transport_tcp.c