All of lore.kernel.org
 help / color / mirror / Atom feed
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Wang Zhaolong <wangzhaolong@huaweicloud.com>
Cc: richard@nod.at,  vigneshr@ti.com,  linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,  chengzhihao1@huawei.com,
	yi.zhang@huawei.com,  yangerkun@huawei.com
Subject: Re: [PATCH] mtd: core: only increment ecc_stats.badblocks on confirmed good->bad transition
Date: Tue, 02 Sep 2025 11:20:02 +0200	[thread overview]
Message-ID: <87zfbdmcsd.fsf@bootlin.com> (raw)
In-Reply-To: <732d629c-d1b9-4483-95c3-9a80bd7b2511@huaweicloud.com> (Wang Zhaolong's message of "Tue, 2 Sep 2025 17:03:54 +0800")

Hello,

>> Said otherwise, the { while () badblocks++ } block shall remain outside
>> of the if (_block_isbad) condition and remain untouched. Just bail out
>> early if you are sure this is not needed.
>> 
>
> I’ll send a V2 shortly that:
>
> - Checks old state when _block_isbad exists and bails out early if already bad
> - Otherwise calls ->_block_markbad() and increments the counter on success, with
>   the increment left outside of the conditional as you suggested

LGTM.

Thanks,
Miquèl

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: Miquel Raynal <miquel.raynal@bootlin.com>
To: Wang Zhaolong <wangzhaolong@huaweicloud.com>
Cc: richard@nod.at,  vigneshr@ti.com,  linux-mtd@lists.infradead.org,
	linux-kernel@vger.kernel.org,  chengzhihao1@huawei.com,
	yi.zhang@huawei.com,  yangerkun@huawei.com
Subject: Re: [PATCH] mtd: core: only increment ecc_stats.badblocks on confirmed good->bad transition
Date: Tue, 02 Sep 2025 11:20:02 +0200	[thread overview]
Message-ID: <87zfbdmcsd.fsf@bootlin.com> (raw)
In-Reply-To: <732d629c-d1b9-4483-95c3-9a80bd7b2511@huaweicloud.com> (Wang Zhaolong's message of "Tue, 2 Sep 2025 17:03:54 +0800")

Hello,

>> Said otherwise, the { while () badblocks++ } block shall remain outside
>> of the if (_block_isbad) condition and remain untouched. Just bail out
>> early if you are sure this is not needed.
>> 
>
> I’ll send a V2 shortly that:
>
> - Checks old state when _block_isbad exists and bails out early if already bad
> - Otherwise calls ->_block_markbad() and increments the counter on success, with
>   the increment left outside of the conditional as you suggested

LGTM.

Thanks,
Miquèl

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

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-02  8:01 [PATCH] mtd: core: only increment ecc_stats.badblocks on confirmed good->bad transition Wang Zhaolong
2025-09-02  8:01 ` Wang Zhaolong
2025-09-02  8:31 ` Miquel Raynal
2025-09-02  8:31   ` Miquel Raynal
2025-09-02  9:03   ` Wang Zhaolong
2025-09-02  9:03     ` Wang Zhaolong
2025-09-02  9:20     ` Miquel Raynal [this message]
2025-09-02  9:20       ` Miquel Raynal

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=87zfbdmcsd.fsf@bootlin.com \
    --to=miquel.raynal@bootlin.com \
    --cc=chengzhihao1@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.com \
    --cc=wangzhaolong@huaweicloud.com \
    --cc=yangerkun@huawei.com \
    --cc=yi.zhang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.