Linux block layer
 help / color / mirror / Atom feed
From: Ira Weiny <ira.weiny@intel.com>
To: Zheng Qixing <zhengqixing@huaweicloud.com>, <axboe@kernel.dk>,
	<song@kernel.org>, <yukuai3@huawei.com>,
	<dan.j.williams@intel.com>, <vishal.l.verma@intel.com>,
	<dave.jiang@intel.com>, <ira.weiny@intel.com>,
	<dlemoal@kernel.org>, <kch@nvidia.com>, <yanjun.zhu@linux.dev>,
	<hare@suse.de>, <zhengqixing@huawei.com>, <colyli@kernel.org>,
	<geliang@kernel.org>, <xni@redhat.com>
Cc: <linux-block@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	<linux-raid@vger.kernel.org>, <nvdimm@lists.linux.dev>,
	<yi.zhang@huawei.com>, <yangerkun@huawei.com>
Subject: Re: [PATCH V2 12/12] badblocks: use sector_t instead of int to avoid truncation of badblocks length
Date: Thu, 27 Feb 2025 09:27:11 -0600	[thread overview]
Message-ID: <67c0844fe82af_b2959294d1@iweiny-mobl.notmuch> (raw)
In-Reply-To: <20250227075507.151331-13-zhengqixing@huaweicloud.com>

Zheng Qixing wrote:
> From: Zheng Qixing <zhengqixing@huawei.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]

  reply	other threads:[~2025-02-27 15:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-02-27  7:54 [PATCH V2 00/12] badblocks: bugfix and cleanup for badblocks Zheng Qixing
2025-02-27  7:54 ` [PATCH V2 01/12] badblocks: Fix error shitf ops Zheng Qixing
2025-02-27  7:54 ` [PATCH V2 02/12] badblocks: factor out a helper try_adjacent_combine Zheng Qixing
2025-02-27  7:54 ` [PATCH V2 03/12] badblocks: attempt to merge adjacent badblocks during ack_all_badblocks Zheng Qixing
2025-02-27  7:54 ` [PATCH V2 04/12] badblocks: return error directly when setting badblocks exceeds 512 Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 05/12] badblocks: return error if any badblock set fails Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 06/12] badblocks: fix the using of MAX_BADBLOCKS Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 07/12] badblocks: try can_merge_front before overlap_front Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 08/12] badblocks: fix merge issue when new badblocks align with pre+1 Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 09/12] badblocks: fix missing bad blocks on retry in _badblocks_check() Zheng Qixing
2025-02-27  7:55 ` [PATCH V2 10/12] badblocks: return boolean from badblocks_set() and badblocks_clear() Zheng Qixing
2025-02-27 15:08   ` Ira Weiny
2025-02-27  7:55 ` [PATCH V2 11/12] md: improve return types of badblocks handling functions Zheng Qixing
2025-02-27 11:48   ` Yu Kuai
2025-02-27  7:55 ` [PATCH V2 12/12] badblocks: use sector_t instead of int to avoid truncation of badblocks length Zheng Qixing
2025-02-27 15:27   ` Ira Weiny [this message]
2025-03-05  1:29     ` Yu Kuai
2025-03-05  1:41 ` [PATCH V2 00/12] badblocks: bugfix and cleanup for badblocks Yu Kuai
2025-03-06 15:05 ` Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=67c0844fe82af_b2959294d1@iweiny-mobl.notmuch \
    --to=ira.weiny@intel.com \
    --cc=axboe@kernel.dk \
    --cc=colyli@kernel.org \
    --cc=dan.j.williams@intel.com \
    --cc=dave.jiang@intel.com \
    --cc=dlemoal@kernel.org \
    --cc=geliang@kernel.org \
    --cc=hare@suse.de \
    --cc=kch@nvidia.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-raid@vger.kernel.org \
    --cc=nvdimm@lists.linux.dev \
    --cc=song@kernel.org \
    --cc=vishal.l.verma@intel.com \
    --cc=xni@redhat.com \
    --cc=yangerkun@huawei.com \
    --cc=yanjun.zhu@linux.dev \
    --cc=yi.zhang@huawei.com \
    --cc=yukuai3@huawei.com \
    --cc=zhengqixing@huawei.com \
    --cc=zhengqixing@huaweicloud.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox