summaryrefslogtreecommitdiff
path: root/rust/kernel/alloc/kvec
diff options
context:
space:
mode:
authorYingjie Wang <x-professor@outlook.com>2026-11-05 15:49:27 +0000
committerMikulas Patocka <mpatocka@redhat.com>2026-11-05 21:19:06 +0100
commitae5b40accbc06f93e6a513e0e9a07fd32b197e49 (patch)
treea3c3fe044f56cedf14c3805b647216e62757c476 /rust/kernel/alloc/kvec
parentdf8daa4d916c88ef7888c738e0eb3b6f11714a6f (diff)
dm mpath: cap queue_if_no_path_timeout_secs
enable_nopath_timeout() arms the no-path timer with jiffies + queue_if_no_path_timeout_secs * HZ. The module parameter is an unbounded unsigned long, so the delay can exceed what mod_timer() handles: a delay above LONG_MAX is treated as already expired, and values above ULONG_MAX / HZ also wrap in the multiplication. The timer then clears queue_if_no_path right away, and I/O queued after the last path fails gets -EIO instead of waiting for the configured time. On x86-64 with HZ=1000, 9223372036854776 seconds failed a write after 124 ms while one second less remained queued throughout a 4.2-second observation window. A value of 18446744073709552 seconds wrapped to 384 jiffies and failed the write after 455 ms. On 32-bit kernels with HZ=1000 the delay passes LONG_MAX above 2147483 seconds, a little under 25 days. Cap the seconds value at the largest whole-second delay not exceeding MAX_JIFFY_OFFSET before multiplying by HZ. This prevents signed-delta overflow and multiplication wrap. The timer wheel's existing handling of very long delays is unchanged. Fixes: be240ff5e402 ("dm mpath: Add timeout mechanism for queue_if_no_path") Cc: stable@vger.kernel.org Signed-off-by: Yingjie Wang <x-professor@outlook.com> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Diffstat (limited to 'rust/kernel/alloc/kvec')
0 files changed, 0 insertions, 0 deletions