Commit f01e2d16 authored by Artem Bityutskiy's avatar Artem Bityutskiy

UBI: always warn if case of I/O errors

Currently UBI silently retries I/O operation in case of errors. This patch
makes it emit a warning before retrying. This should allow users notice issues
earlier.
Signed-off-by: default avatarArtem Bityutskiy <artem.bityutskiy@linux.intel.com>
parent a904e3f1
...@@ -189,9 +189,9 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset, ...@@ -189,9 +189,9 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
} }
if (retries++ < UBI_IO_RETRIES) { if (retries++ < UBI_IO_RETRIES) {
dbg_io("error %d%s while reading %d bytes from PEB " ubi_warn("error %d%s while reading %d bytes from PEB "
"%d:%d, read only %zd bytes, retry", "%d:%d, read only %zd bytes, retry",
err, errstr, len, pnum, offset, read); err, errstr, len, pnum, offset, read);
yield(); yield();
goto retry; goto retry;
} }
...@@ -364,8 +364,8 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum) ...@@ -364,8 +364,8 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum)
err = mtd_erase(ubi->mtd, &ei); err = mtd_erase(ubi->mtd, &ei);
if (err) { if (err) {
if (retries++ < UBI_IO_RETRIES) { if (retries++ < UBI_IO_RETRIES) {
dbg_io("error %d while erasing PEB %d, retry", ubi_warn("error %d while erasing PEB %d, retry",
err, pnum); err, pnum);
yield(); yield();
goto retry; goto retry;
} }
...@@ -383,7 +383,7 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum) ...@@ -383,7 +383,7 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum)
if (ei.state == MTD_ERASE_FAILED) { if (ei.state == MTD_ERASE_FAILED) {
if (retries++ < UBI_IO_RETRIES) { if (retries++ < UBI_IO_RETRIES) {
dbg_io("error while erasing PEB %d, retry", pnum); ubi_warn("error while erasing PEB %d, retry", pnum);
yield(); yield();
goto retry; goto retry;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment