[PATCH] ubi: Speedup ubi_io_read_vid_hdr()

Richard Weinberger richard at nod.at
Mon Jun 27 00:05:59 PDT 2016


Am 27.06.2016 um 07:22 schrieb Sascha Hauer:
> On Sat, Jun 25, 2016 at 10:39:51AM +0200, Richard Weinberger wrote:
>> Currently we read a whole (sub)page from flash when reading
>> the VID header.
>> Sascha reported that reading only UBI_VID_HDR_SIZE instead
>> gives him a decent speedup during a full scan.
>>
>> Since we have to obey shifted headers too we have to read
>> ubi->vid_hdr_shift + UBI_VID_HDR_SIZE bytes.
>> It is also important to set the buffer to 0xff bytes before
>> reading as in ubi_io_write_vid_hdr() the whole (sub)page
>> is written back to flash and we cannot risk leaking
>> kernel memory into the storage medium.
>>
>> Reported-by: Sascha Hauer <s.hauer at pengutronix.de>
>> Signed-off-by: Richard Weinberger <richard at nod.at>
>> ---
>> Sascha,
>>
>> can you please this patch a try?
> 
> I already did, this was exactly my suggestion after you mentioned that
> my initial patch breaks when vid_hdr_shift is non zero.
> I tested it without the memset though.

Yeah, the memset() is not needed, I was wrong.
So we can take your version.

Thanks,
//richard



More information about the linux-mtd mailing list