lkml.org 
[lkml]   [2023]   [Sep]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] mtd: Fix error code loss in mtdchar_read() function.
----- Ursprüngliche Mail -----
> Von: "Miquel Raynal" <miquel.raynal@bootlin.com>
>> Given this a second thought. I don't think a NAND driver is allowed to return
>> less than requests bytes and setting EBADMSG.
>> UBI's IO path has a comment on that:
>>
>> /*
>> * The driver should never return -EBADMSG if it failed to read
>> * all the requested data. But some buggy drivers might do
>> * this, so we change it to -EIO.
>> */
>> if (read != len && mtd_is_eccerr(err)) {
>> ubi_assert(0);
>> err = -EIO;
>> }
>
> Interesting. Shall we add this check to the mtd_read() path as well?
>
> Maybe with a WARN_ON()?

WARN_ON_ONCE(), please. But yes, let's add it.

Thanks,
//richard

\
 
 \ /
  Last update: 2023-09-25 17:00    [W:4.648 / U:0.000 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site