Skip to contentSkip to conversation

Fix docg3 read align bug

PATCH Robert Jarzmik 2 participants 2 messages Mar 25, 2012 – Mar 26, 2012

Subsystems (2)
lore
Share & tools
lore

Robert Jarzmik

author maintainer
#0 lore raw

Hi Artem,

I sent not long ago a patch for unaligned reads. And ... I made an error. I have a patch to patch my previous submission. I wonder if this can be squashed in, or requires an incremental commit. Tell me what you want to do, the patch is at the end of the mail.

I hope I have not overseen another corner case, I'll recheck tomorrow evening (GMT+1).

Cheers.

Signature · 3 lines
Robert

---8>---
Quoted 1 line

From c013bc50a456c3c127eae3f1751369dec1e32221 Mon Sep 17 00:00:00 2001

From: Robert Jarzmik <[email protected]>
Date: Sun, 25 Mar 2012 23:26:05 +0200
Subject: [PATCH] mtd: docg3 refix docg3 lessen read alignement burden

After the fix "mtd: docg3 less read alignement burden", a corner case where read is unaligned an length read is small was left. As a full page must be read, the remaining data bytes to read number was miscalculated, leading to unreadable LEBs by UBIFS.

---
 drivers/mtd/devices/docg3.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/mtd/devices/docg3.c +2 -1
index 7ced089..8272c02 100644
@@ -893,7 +893,8 @@ static int doc_read_oob(struct mtd_info *mtd, loff_t from,
 		ret = doc_read_page_getbytes(docg3, nbdata, buf, 0);
 		if (ret < nbdata)
 			goto err_in_read;
-		doc_read_page_getbytes(docg3, DOC_LAYOUT_PAGE_SIZE - nbdata,
+		doc_read_page_getbytes(docg3,
+				       DOC_LAYOUT_PAGE_SIZE - nbdata - skip,
 				       NULL, 0);
 		ret = doc_read_page_getbytes(docg3, nboob, oobbuf, 0);
 		if (ret < nboob)
Signature · 1 line
1.7.5.4
#1 lore raw
Quoted 9 lines · Robert Jarzmik

Hi Artem,

I sent not long ago a patch for unaligned reads. And ... I made an error. I have a patch to patch my previous submission. I wonder if this can be squashed in, or requires an incremental commit. Tell me what you want to do, the patch is at the end of the mail.

I hope I have not overseen another corner case, I'll recheck tomorrow evening (GMT+1).

Shoved in, thanks!

Signature · 2 lines
Best Regards,
Artem Bityutskiy