* [PATCH] UBI: improve messages in ubi_eba_read_leb()
@ 2015-02-10 3:40 hujianyang
2015-02-10 8:05 ` Artem Bityutskiy
0 siblings, 1 reply; 4+ messages in thread
From: hujianyang @ 2015-02-10 3:40 UTC (permalink / raw)
To: Artem Bityutskiy, Richard Weinberger; +Cc: 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, like:
[ 38.442770] UBI error: ubi_io_read: error -74 (ECC error) while reading 26624 bytes from PEB 54:104448, read 26624 bytes
[ 38.852461] UBI error: ubi_io_read: error -74 (ECC error) while reading 77824 bytes from PEB 346:53248, read 77824 bytes
[ 38.864142] UBIFS error (pid 1444): ubifs_recover_leb: corruption -3
[ 38.870487] UBIFS error (pid 1444): ubifs_scanned_corruption: corruption at LEB 928:55280
[ 38.878625] UBIFS error (pid 1444): ubifs_scanned_corruption: first 8192 bytes from LEB 928:55280
[ 38.892117] UBIFS error (pid 1444): ubifs_recover_leb: LEB 928 scanning failed
mount: mounting ubi1:bak on /mountpoint: failed: Structure needs cleaning
This patch improve the output of ubi_eba_read_leb() by printing the
mapping of LEB and PEB if an ECC error occur. And also, print PEB
and LEB number if a CRC error occur.
Signed-off-by: hujianyang <hujianyang@huawei.com>
---
drivers/mtd/ubi/eba.c | 9 ++++++---
1 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/drivers/mtd/ubi/eba.c b/drivers/mtd/ubi/eba.c
index da4c792..349fe5d 100644
--- a/drivers/mtd/ubi/eba.c
+++ b/drivers/mtd/ubi/eba.c
@@ -445,8 +445,11 @@ retry:
if (err == UBI_IO_BITFLIPS)
scrub = 1;
else if (mtd_is_eccerr(err)) {
- if (vol->vol_type == UBI_DYNAMIC_VOLUME)
+ if (vol->vol_type == UBI_DYNAMIC_VOLUME) {
+ ubi_warn(ubi, "ECC error while reading %d bytes from offset %d of LEB %d:%d, PEB %d",
+ len, offset, vol_id, lnum, pnum);
goto out_unlock;
+ }
scrub = 1;
if (!check) {
ubi_msg(ubi, "force data checking");
@@ -460,8 +463,8 @@ retry:
if (check) {
uint32_t crc1 = crc32(UBI_CRC32_INIT, buf, len);
if (crc1 != crc) {
- ubi_warn(ubi, "CRC error: calculated %#08x, must be %#08x",
- crc1, crc);
+ ubi_warn(ubi, "CRC error at PEB %d, LEB %d:%d: calculated %#08x, must be %#08x",
+ pnum, vol_id, lnum, crc1, crc);
err = -EBADMSG;
goto out_unlock;
}
--
1.6.0.2
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] UBI: improve messages in ubi_eba_read_leb()
2015-02-10 3:40 [PATCH] UBI: improve messages in ubi_eba_read_leb() hujianyang
@ 2015-02-10 8:05 ` Artem Bityutskiy
2015-02-10 9:30 ` Richard Weinberger
0 siblings, 1 reply; 4+ messages in thread
From: Artem Bityutskiy @ 2015-02-10 8:05 UTC (permalink / raw)
To: hujianyang; +Cc: Richard Weinberger, linux-mtd
On Tue, 2015-02-10 at 11:40 +0800, hujianyang wrote:
> 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, like:
>
> [ 38.442770] UBI error: ubi_io_read: error -74 (ECC error) while reading 26624 bytes from PEB 54:104448, read 26624 bytes
> [ 38.852461] UBI error: ubi_io_read: error -74 (ECC error) while reading 77824 bytes from PEB 346:53248, read 77824 bytes
> [ 38.864142] UBIFS error (pid 1444): ubifs_recover_leb: corruption -3
> [ 38.870487] UBIFS error (pid 1444): ubifs_scanned_corruption: corruption at LEB 928:55280
> [ 38.878625] UBIFS error (pid 1444): ubifs_scanned_corruption: first 8192 bytes from LEB 928:55280
> [ 38.892117] UBIFS error (pid 1444): ubifs_recover_leb: LEB 928 scanning failed
> mount: mounting ubi1:bak on /mountpoint: failed: Structure needs cleaning
>
> This patch improve the output of ubi_eba_read_leb() by printing the
> mapping of LEB and PEB if an ECC error occur. And also, print PEB
> and LEB number if a CRC error occur.
>
> Signed-off-by: hujianyang <hujianyang@huawei.com>
Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] UBI: improve messages in ubi_eba_read_leb()
2015-02-10 8:05 ` Artem Bityutskiy
@ 2015-02-10 9:30 ` Richard Weinberger
2015-05-15 8:23 ` hujianyang
0 siblings, 1 reply; 4+ messages in thread
From: Richard Weinberger @ 2015-02-10 9:30 UTC (permalink / raw)
To: Artem Bityutskiy; +Cc: Richard Weinberger, linux-mtd, hujianyang
On Tue, Feb 10, 2015 at 9:05 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
> On Tue, 2015-02-10 at 11:40 +0800, hujianyang wrote:
>> 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, like:
>>
>> [ 38.442770] UBI error: ubi_io_read: error -74 (ECC error) while reading 26624 bytes from PEB 54:104448, read 26624 bytes
>> [ 38.852461] UBI error: ubi_io_read: error -74 (ECC error) while reading 77824 bytes from PEB 346:53248, read 77824 bytes
>> [ 38.864142] UBIFS error (pid 1444): ubifs_recover_leb: corruption -3
>> [ 38.870487] UBIFS error (pid 1444): ubifs_scanned_corruption: corruption at LEB 928:55280
>> [ 38.878625] UBIFS error (pid 1444): ubifs_scanned_corruption: first 8192 bytes from LEB 928:55280
>> [ 38.892117] UBIFS error (pid 1444): ubifs_recover_leb: LEB 928 scanning failed
>> mount: mounting ubi1:bak on /mountpoint: failed: Structure needs cleaning
>>
>> This patch improve the output of ubi_eba_read_leb() by printing the
>> mapping of LEB and PEB if an ECC error occur. And also, print PEB
>> and LEB number if a CRC error occur.
>>
>> Signed-off-by: hujianyang <hujianyang@huawei.com>
>
> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
As the merge window is already open I'd wait until the next merge
window with that patch.
--
Thanks,
//richard
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] UBI: improve messages in ubi_eba_read_leb()
2015-02-10 9:30 ` Richard Weinberger
@ 2015-05-15 8:23 ` hujianyang
0 siblings, 0 replies; 4+ messages in thread
From: hujianyang @ 2015-05-15 8:23 UTC (permalink / raw)
To: Richard Weinberger; +Cc: Richard Weinberger, linux-mtd, Artem Bityutskiy
On 2015/2/10 17:30, Richard Weinberger wrote:
> On Tue, Feb 10, 2015 at 9:05 AM, Artem Bityutskiy <dedekind1@gmail.com> wrote:
>> On Tue, 2015-02-10 at 11:40 +0800, hujianyang wrote:
>>> 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, like:
>>>
>>> [ 38.442770] UBI error: ubi_io_read: error -74 (ECC error) while reading 26624 bytes from PEB 54:104448, read 26624 bytes
>>> [ 38.852461] UBI error: ubi_io_read: error -74 (ECC error) while reading 77824 bytes from PEB 346:53248, read 77824 bytes
>>> [ 38.864142] UBIFS error (pid 1444): ubifs_recover_leb: corruption -3
>>> [ 38.870487] UBIFS error (pid 1444): ubifs_scanned_corruption: corruption at LEB 928:55280
>>> [ 38.878625] UBIFS error (pid 1444): ubifs_scanned_corruption: first 8192 bytes from LEB 928:55280
>>> [ 38.892117] UBIFS error (pid 1444): ubifs_recover_leb: LEB 928 scanning failed
>>> mount: mounting ubi1:bak on /mountpoint: failed: Structure needs cleaning
>>>
>>> This patch improve the output of ubi_eba_read_leb() by printing the
>>> mapping of LEB and PEB if an ECC error occur. And also, print PEB
>>> and LEB number if a CRC error occur.
>>>
>>> Signed-off-by: hujianyang <hujianyang@huawei.com>
>>
>> Signed-off-by: Artem Bityutskiy <artem.bityutskiy@linux.intel.com>
>
> As the merge window is already open I'd wait until the next merge
> window with that patch.
>
Ping?
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2015-05-15 8:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-10 3:40 [PATCH] UBI: improve messages in ubi_eba_read_leb() hujianyang
2015-02-10 8:05 ` Artem Bityutskiy
2015-02-10 9:30 ` Richard Weinberger
2015-05-15 8:23 ` hujianyang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox