Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mtdblock: tolerate corrected bit-flips

mtd_read() may return -EUCLEAN in case of corrected bit-flips.This
particular condition should not be treated like an error.

Signed-off-by: Bang Li <libang.linuxer@gmail.com>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/20230314165653.252673-1-libang.linuxer@gmail.com

authored by

Bang Li and committed by
Miquel Raynal
e6b0922a 57150c40

+3 -1
+3 -1
drivers/mtd/mtdblock_ro.c
··· 16 16 unsigned long block, char *buf) 17 17 { 18 18 size_t retlen; 19 + int err; 19 20 20 - if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf)) 21 + err = mtd_read(dev->mtd, (block * 512), 512, &retlen, buf); 22 + if (err && !mtd_is_bitflip(err)) 21 23 return 1; 22 24 return 0; 23 25 }