[U-Boot] [PATCH] FIX: fat: Provide correct return code from disk_{read|write} to upper layers
Tom Rini
trini at konsulko.com
Thu Sep 3 14:44:09 CEST 2015
On Thu, Sep 03, 2015 at 02:21:39PM +0200, Lukasz Majewski wrote:
> It is very common that FAT code is using following pattern:
> if (disk_{read|write}() < 0)
> return -1;
>
> Up till now the above code was dead, since disk_{read|write) could only
> return value >= 0.
> As a result some errors from medium layer (i.e. eMMC/SD) were not caught.
>
> The above behavior was caused by block_{read|write|erase} declared at
> struct block_dev_desc (@part.h). It returns unsigned long, where 0
> indicates error and > 0 indicates that medium operation was correct.
>
> This patch as error regards 0 returned from block_{read|write|erase}
> when nr_blocks is grater than zero. Read/Write operation with nr_blocks=0
> should return 0 and hence is not considered as an error.
>
> Signed-off-by: Lukasz Majewski <l.majewski at samsung.com>
>
> Test HW: Odroid XU3 - Exynos 5433
Can you pick up Stephen's FAT replacement series and see if it also
fixes this problem? Thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20150903/2f4fe1e7/attachment.sig>
More information about the U-Boot
mailing list