[PATCH 1/1] mtd: ubi: skip programming unused bits in ubi headers

Richard Weinberger richard at nod.at
Fri Nov 7 01:12:35 PST 2025


----- Ursprüngliche Mail -----
> Von: "Cheng Ming Lin" <linchengming884 at gmail.com>
>> Here I am reaching the limits of my UBI knowledge, so I would prefer
>> Richard to (in)validate what I am saying, but AFAIU, the VID header can
>> be literally anywhere in the page, not just at the start or end of a
>> subpage, so in the vid_hdr_shift I would expect some extra maths to
>> happen, no?

Good catch!
I had to read the code change twice to see the problem, though. :-S

> I understand your point now. If the VID header is not guaranteed to be
> at the start or end of a subpage, then yes, my current logic needs to be
> reworked to cover that case.

Yes. This can be configured using ubiattach --vid-hdr-offset ...
With nandsim you can test all kind of combinations.

Thanks,
//richard



More information about the linux-mtd mailing list