public inbox for linux-mtd@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] UBI: add ubi_err() to report the failure of leb read
@ 2014-12-16  7:54 hujianyang
  2014-12-16  8:02 ` hujianyang
  2014-12-16  8:58 ` Richard Weinberger
  0 siblings, 2 replies; 8+ messages in thread
From: hujianyang @ 2014-12-16  7:54 UTC (permalink / raw)
  To: Artem Bityutskiy; +Cc: Richard Weinberger, linux-mtd

If an error occur while reading from PEBs, for example, an ECC error,
ubi_io_read() will print some error messages. But it's not enough for
debugging. These messages don't show the mapping info for a read from
UBIFS layer.

Although UBIFS will soon print its error messages after catching the
return value from UBI layer,  multi-path reading will confuse the
relationship between LEBs and PEBs showed by these messages.

This patch adds an ubi_err() to report reading errors in the function
ubi_eba_read_leb(). The mapping info of LEB and PEB is showed by
this error message.

Signed-off-by: hujianyang <hujianyang@huawei.com>
---
 drivers/mtd/ubi/eba.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index b698534..b4e69e1 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -477,6 +477,8 @@ out_free:
 	ubi_free_vid_hdr(ubi, vid_hdr);
 out_unlock:
 	leb_read_unlock(ubi, vol_id, lnum);
+	ubi_err(ubi, "err %d while reading %d bytes from offset %d of LEB %d:%d, PEB %d",
+		err, len, offset, vol_id, lnum, pnum);
 	return err;
 }

-- 
1.6.0.2

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-12-16 10:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-16  7:54 [PATCH] UBI: add ubi_err() to report the failure of leb read hujianyang
2014-12-16  8:02 ` hujianyang
2014-12-16  9:21   ` Richard Weinberger
2014-12-16  9:52     ` hujianyang
2014-12-16  9:57       ` Richard Weinberger
2014-12-16 10:34         ` hujianyang
2014-12-16  8:58 ` Richard Weinberger
2014-12-16 10:12   ` hujianyang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox