Re: [PATCH v6 1/3] nvme-multipath: keep a large delayed_removal_secs from wrapping around
From: Nilay Shroff
Date: Fri Nov 20 2026 - 12:36:38 EST
On 11/20/26 6:55 AM, Qiliang Yuan wrote:
nvme_mpath_remove_disk() delays the removal of a namespace head that
lost its last path by delayed_removal_secs, which it converts to
jiffies as delayed_removal_secs * HZ.
delayed_removal_secs is an unsigned int, so the product is computed in
32 bits and wraps around for values above UINT_MAX / HZ. With HZ=1000,
4294968 seconds turns into a delay of 704 jiffies, and the head goes
away in under a second instead of after about 50 days.
Compute the delay in 64 bits and cap it at MAX_JIFFY_OFFSET.
With delayed_removal_secs set to 4294968 at HZ=1000, removing the last
path deletes the head after (mean of two runs, min-max in parentheses;
"> 10000" means it was still there 10 s later):
before (ms) after (ms)
858 (856-860) > 10000
Fixes: 62188639ec160 ("nvme-multipath: introduce delayed removal of the multipath head node")
Signed-off-by: Qiliang Yuan <qiliang.yuan@xxxxxxxxx>
Looks good to me:
Reviewed-by: Nilay Shroff <nilay@xxxxxxxxxxxxx>