[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <67c0844fe82af_b2959294d1@iweiny-mobl.notmuch>
Date: Thu, 27 Feb 2025 09:27:11 -0600
From: Ira Weiny <ira.weiny@...el.com>
To: Zheng Qixing <zhengqixing@...weicloud.com>, <axboe@...nel.dk>,
<song@...nel.org>, <yukuai3@...wei.com>, <dan.j.williams@...el.com>,
<vishal.l.verma@...el.com>, <dave.jiang@...el.com>, <ira.weiny@...el.com>,
<dlemoal@...nel.org>, <kch@...dia.com>, <yanjun.zhu@...ux.dev>,
<hare@...e.de>, <zhengqixing@...wei.com>, <colyli@...nel.org>,
<geliang@...nel.org>, <xni@...hat.com>
CC: <linux-block@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-raid@...r.kernel.org>, <nvdimm@...ts.linux.dev>,
<yi.zhang@...wei.com>, <yangerkun@...wei.com>
Subject: Re: [PATCH V2 12/12] badblocks: use sector_t instead of int to avoid
truncation of badblocks length
Zheng Qixing wrote:
> From: Zheng Qixing <zhengqixing@...wei.com>
>
> There is a truncation of badblocks length issue when set badblocks as
> follow:
>
> echo "2055 4294967299" > bad_blocks
> cat bad_blocks
> 2055 3
>
> Change 'sectors' argument type from 'int' to 'sector_t'.
>
> This change avoids truncation of badblocks length for large sectors by
> replacing 'int' with 'sector_t' (u64), enabling proper handling of larger
> disk sizes and ensuring compatibility with 64-bit sector addressing.
__add_badblock_range() in drivers/nvdimm/badrange.c limits the number of
badblocks which can be set in each call to badblocks_set().
After this change can that algorithm be eliminated? I'm not familiar with
the badblocks code to know for certain.
Regardless I think the types used in badrange.c could be updated with this
change.
Also pmem_clear_bb() should have it's type changed to match
badblocks_clear()
Ira
[snip]
Powered by blists - more mailing lists