From: Ashok Raj <ashok_raj@linux.intel.com>
To: linan666@huaweicloud.com
Cc: axboe@kernel.dk, linan122@huawei.com, dan.j.williams@intel.com,
vishal.l.verma@intel.com, linux-block@vger.kernel.org,
linux-kernel@vger.kernel.org, yukuai3@huawei.com,
yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com,
Ashok Raj <ashok.raj@intel.com>
Subject: Re: [PATCH v3 4/4] block/badblocks: fix the bug of reverse order
Date: Wed, 21 Jun 2023 07:15:40 -0700 [thread overview]
Message-ID: <ZJMGDLkRbaVD9VA8@araj-dh-work> (raw)
In-Reply-To: <20230621172052.1499919-5-linan666@huaweicloud.com>
On Thu, Jun 22, 2023 at 01:20:52AM +0800, linan666@huaweicloud.com wrote:
> From: Li Nan <linan122@huawei.com>
>
> Order of badblocks will be reversed if we set a large area at once. 'hi'
> remains unchanged while adding continuous badblocks is wrong, the next
> setting is greater than 'hi', it should be added to the next position.
> Let 'hi' +1 each cycle.
The commitlog needs more work.
>
> # echo 0 2048 > bad_blocks
> # cat bad_blocks
> 1536 512
> 1024 512
> 512 512
> 0 512
Is the above before or after this patch is applied?
>
> Fixes: 9e0e252a048b ("badblocks: Add core badblock management code")
> Signed-off-by: Li Nan <linan122@huawei.com>
> ---
> block/badblocks.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/block/badblocks.c b/block/badblocks.c
> index 2c2ef8284a3f..3b816690b940 100644
> --- a/block/badblocks.c
> +++ b/block/badblocks.c
> @@ -301,6 +301,7 @@ int badblocks_set(struct badblocks *bb, sector_t s, int sectors,
> p[hi] = BB_MAKE(s, this_sectors, acknowledged);
> sectors -= this_sectors;
> s += this_sectors;
> + hi++;
> changed = true;
> }
> }
> --
> 2.39.2
>
next prev parent reply other threads:[~2023-06-21 14:17 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-06-21 17:20 [PATCH v3 0/4] block/badblocks: fix badblocks setting error linan666
2023-06-21 13:32 ` Ashok Raj
2023-06-25 8:13 ` Li Nan
2023-06-21 17:20 ` [PATCH v3 1/4] block/badblocks: change some members of badblocks to bool linan666
2023-06-21 14:02 ` Ashok Raj
2023-06-25 9:11 ` Li Nan
2023-06-21 17:20 ` [PATCH v3 2/4] block/badblocks: only set bb->changed/unacked_exist when badblocks changes linan666
2023-06-21 17:20 ` [PATCH v3 3/4] block/badblocks: fix badblocks loss when badblocks combine linan666
2023-06-21 14:09 ` Ashok Raj
2023-06-25 9:16 ` Li Nan
2023-06-21 17:20 ` [PATCH v3 4/4] block/badblocks: fix the bug of reverse order linan666
2023-06-21 14:15 ` Ashok Raj [this message]
2023-06-25 9:22 ` Li Nan
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=ZJMGDLkRbaVD9VA8@araj-dh-work \
--to=ashok_raj@linux.intel.com \
--cc=ashok.raj@intel.com \
--cc=axboe@kernel.dk \
--cc=dan.j.williams@intel.com \
--cc=houtao1@huawei.com \
--cc=linan122@huawei.com \
--cc=linan666@huaweicloud.com \
--cc=linux-block@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=vishal.l.verma@intel.com \
--cc=yangerkun@huawei.com \
--cc=yi.zhang@huawei.com \
--cc=yukuai3@huawei.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