Re: [PATCH 2/2] md: widen badblock sectors param from int to sector_t
"yu kuai" <[email protected]> Fri, 31 Jul 2026 03:41:00 +0800
| Newsgroups | org.kernel.vger.linux-raid,org.kernel.vger.linux-kernel |
|---|---|
| Message-ID | <[email protected]> |
在 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<[email protected]> > --- > 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