projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
57150c4
)
mtdblock: tolerate corrected bit-flips
author
Bang Li
<libang.linuxer@gmail.com>
Tue, 14 Mar 2023 16:56:53 +0000
(
00:56
+0800)
committer
Miquel Raynal
<miquel.raynal@bootlin.com>
Wed, 22 Mar 2023 16:02:19 +0000
(17:02 +0100)
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
drivers/mtd/mtdblock_ro.c
patch
|
blob
|
history
diff --git
a/drivers/mtd/mtdblock_ro.c
b/drivers/mtd/mtdblock_ro.c
index 7c51952ce55dee8951eedc3b3fcb76d005bc47b6..66ffc9f1ead2f76aa142f04801fa292de7e8d5e1 100644
(file)
--- a/
drivers/mtd/mtdblock_ro.c
+++ b/
drivers/mtd/mtdblock_ro.c
@@
-16,8
+16,10
@@
static int mtdblock_readsect(struct mtd_blktrans_dev *dev,
unsigned long block, char *buf)
{
size_t retlen;
+ int err;
- if (mtd_read(dev->mtd, (block * 512), 512, &retlen, buf))
+ err = mtd_read(dev->mtd, (block * 512), 512, &retlen, buf);
+ if (err && !mtd_is_bitflip(err))
return 1;
return 0;
}