linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] UBI: fix use of "VID" vs. "EC" in header self-check
@ 2015-11-20 22:10 Brian Norris
  2015-11-20 22:15 ` Richard Weinberger
  0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2015-11-20 22:10 UTC (permalink / raw)
  To: Artem Bityutskiy, Richard Weinberger; +Cc: linux-mtd, Brian Norris

Looks like a typo, using UBI_EC_HDR_SIZE_CRC (note the "EC") to compute
the CRC for the VID header.

This shouldn't cause any functional change, as both structures are 64
bytes. Verified with:

	BUILD_BUG_ON(UBI_VID_HDR_SIZE_CRC != UBI_EC_HDR_SIZE_CRC);

Reported here:
http://lists.infradead.org/pipermail/linux-mtd/2013-September/048570.html

Reported by: Bill Pringlemeir <bpringlemeir@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
---
I was sorting through really old email. Don't ask.

 drivers/mtd/ubi/io.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/mtd/ubi/io.c b/drivers/mtd/ubi/io.c
index 1fc23e48fe8e..10cf3b549959 100644
--- a/drivers/mtd/ubi/io.c
+++ b/drivers/mtd/ubi/io.c
@@ -1299,7 +1299,7 @@ static int self_check_peb_vid_hdr(const struct ubi_device *ubi, int pnum)
 	if (err && err != UBI_IO_BITFLIPS && !mtd_is_eccerr(err))
 		goto exit;
 
-	crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_EC_HDR_SIZE_CRC);
+	crc = crc32(UBI_CRC32_INIT, vid_hdr, UBI_VID_HDR_SIZE_CRC);
 	hdr_crc = be32_to_cpu(vid_hdr->hdr_crc);
 	if (hdr_crc != crc) {
 		ubi_err(ubi, "bad VID header CRC at PEB %d, calculated %#08x, read %#08x",
-- 
2.6.0.rc2.230.g3dd15c0

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

* Re: [PATCH] UBI: fix use of "VID" vs. "EC" in header self-check
  2015-11-20 22:10 [PATCH] UBI: fix use of "VID" vs. "EC" in header self-check Brian Norris
@ 2015-11-20 22:15 ` Richard Weinberger
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Weinberger @ 2015-11-20 22:15 UTC (permalink / raw)
  To: Brian Norris, Artem Bityutskiy; +Cc: linux-mtd

Am 20.11.2015 um 23:10 schrieb Brian Norris:
> Looks like a typo, using UBI_EC_HDR_SIZE_CRC (note the "EC") to compute
> the CRC for the VID header.
> 
> This shouldn't cause any functional change, as both structures are 64
> bytes. Verified with:
> 
> 	BUILD_BUG_ON(UBI_VID_HDR_SIZE_CRC != UBI_EC_HDR_SIZE_CRC);
> 
> Reported here:
> http://lists.infradead.org/pipermail/linux-mtd/2013-September/048570.html
> 
> Reported by: Bill Pringlemeir <bpringlemeir@gmail.com>
> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
> ---
> I was sorting through really old email. Don't ask.

Patch looks good, thanks for the exhumation! ;)

Thanks,
//richard

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

end of thread, other threads:[~2015-11-20 22:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-20 22:10 [PATCH] UBI: fix use of "VID" vs. "EC" in header self-check Brian Norris
2015-11-20 22:15 ` Richard Weinberger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).