Re: [PATCH] mtd: rawnand: stop BBT creation when the marker scan fails

From: Miquel Raynal

Date: Thu Nov 19 2026 - 03:38:35 EST


On 18/11/2026 at 12:11:19 -07, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:

> On Wed, Nov 18, 2026 at 2:45 AM Miquel Raynal <miquel.raynal@xxxxxxxxxxx> wrote:
>>
>> On 03/11/2026 at 22:52:39 -07, James Hilliard <james.hilliard1@xxxxxxxxx> wrote:
>>
>> > create_bbt() returns an error if reading a bad-block marker fails,
>>
>> This sentence does not mean anything.
>>
>> > but
>> > check_create() ignores that result. It can assign version 1 to the
>>
>> That's also unclear.
>
> It's just stating where an unchecked return exists along with the
> potential consequences of continuing without checking the return.
> At least that was how I read it.
>
> Is this commit message phrasing/style weird or something?

See just below one example:

>> > incomplete RAM table and write it to the primary and mirror
>>locations.

"the primary and mirror locations" -> this is a detail, that's not what
matters.

>> > Unscanned factory-bad blocks then appear good in the persisted
>> > tables.
>>
>> Here is a proposal which I believe makes more sense:
>>
>> mtd: rawnand: abort BBT creation on scan failure
>>
>> create_bbt() can fail on a non-ECC OOB read error, leaving the RAM BBT
>> partially populated. It is preferable to bail out early rather than bump
>> the table versions and write incomplete primary and mirror tables, which
>> would mark the unscanned factory-bad blocks as good.
>
> Personally I try to avoid terminology like "preferable" when
> describing

Yes, fine.

> code behavior that's clearly wrong, as "preferable" to me at least weakly
> implies that the code issue being fixed could be more of a style issue
> rather than a correctness issue.
>
> To me both commit messages seem to be equally understandable.
>
>>
>> > Propagate the scan failure before changing table versions or writing
>> > either copy. Keep explicit NAND_BBT_CREATE_EMPTY initialization unchanged.
>> >
>> > Fixes: eeada24da8bd ("[MTD] NAND: Read only OOB bytes during bad block scan")
>> > Signed-off-by: James Hilliard <james.hilliard1@xxxxxxxxx>
>>
>> I would prefer if you could write your own commit logs, giving us more
>> confidence on the work that has been asked. You can use an LLM to
>> improve/enhance it obviously.
>
> To be honest I've never been great at writing commit messages in
> general and have gotten a lot more complaints about commit messages
> missing important details prior to using LLM's. I can barely tell the

For me the code is getting better but the commit logs are unclear. Some
details which don't need (imo) to be written are there, and the big
picture is often missing or not clearly stated before the details.

Don't get me wrong, using an LLM to refine/reword/reorganize is fine,
but letting the LLM write it entirely is not working well.

Thanks,
Miquèl