Skip to content

Commit

Permalink
UBI: always warn if case of I/O errors
Browse files Browse the repository at this point in the history
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: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
  • Loading branch information
Artem Bityutskiy committed May 20, 2012
1 parent a904e3f commit f01e2d1
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/mtd/ubi/io.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,9 @@ int ubi_io_read(const struct ubi_device *ubi, void *buf, int pnum, int offset,
}

if (retries++ < UBI_IO_RETRIES) {
dbg_io("error %d%s while reading %d bytes from PEB "
"%d:%d, read only %zd bytes, retry",
err, errstr, len, pnum, offset, read);
ubi_warn("error %d%s while reading %d bytes from PEB "
"%d:%d, read only %zd bytes, retry",
err, errstr, len, pnum, offset, read);
yield();
goto retry;
}
Expand Down Expand Up @@ -364,8 +364,8 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum)
err = mtd_erase(ubi->mtd, &ei);
if (err) {
if (retries++ < UBI_IO_RETRIES) {
dbg_io("error %d while erasing PEB %d, retry",
err, pnum);
ubi_warn("error %d while erasing PEB %d, retry",
err, pnum);
yield();
goto retry;
}
Expand All @@ -383,7 +383,7 @@ static int do_sync_erase(struct ubi_device *ubi, int pnum)

if (ei.state == MTD_ERASE_FAILED) {
if (retries++ < UBI_IO_RETRIES) {
dbg_io("error while erasing PEB %d, retry", pnum);
ubi_warn("error while erasing PEB %d, retry", pnum);
yield();
goto retry;
}
Expand Down

0 comments on commit f01e2d1

Please sign in to comment.