Re: [PATCH 2/2] md: widen badblock sectors param from int to sector_t
From: yu kuai
Date: Thu Jul 30 2026 - 15:54:45 EST
在 2026/7/10 21:23, Hiroshi Nishida 写道:
> The badblocks core API -- badblocks_set(), badblocks_clear() and
> badblocks_check() -- and the is_badblock() helper all take the range
> length as sector_t. The md wrappers rdev_set_badblocks(),
> rdev_clear_badblocks() and rdev_has_badblock(), however, declared the
> same length as int, narrowing sector_t to int and back again in the
> middle of an otherwise 64-bit clean path.
>
> Change the sectors parameter to sector_t in these three wrappers so it
> matches the core API and is_badblock(). No functional change: current
> callers pass per-I/O or per-resync-chunk lengths well within int range.
> This just removes a gratuitous truncation point and keeps the type
> consistent end to end.
>
> Signed-off-by: Hiroshi Nishida<nishidafmly@xxxxxxxxx>
> ---
> drivers/md/md.c | 4 ++--
> drivers/md/md.h | 6 +++---
> 2 files changed, 5 insertions(+), 5 deletions(-)
Applied patch 2 to md-7.3
--
Thanks,
Kuai