[JFFS2] Fix unpoint length

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Sun Sep 23 13:59:01 EDT 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=59d8235be2ab38ddaffbe9137385095a5e8b0a77
Commit:     59d8235be2ab38ddaffbe9137385095a5e8b0a77
Parent:     097f2576eb7dbc8cd5f610847f229f4fea305b80
Author:     Andy Lowe <alowe at mvista.com>
AuthorDate: Fri Jan 12 18:05:24 2007 -0500
Committer:  David Woodhouse <dwmw2 at infradead.org>
CommitDate: Sun Sep 23 18:41:17 2007 +0100

    [JFFS2] Fix unpoint length
    
    Fix a couple of instances in JFFS2 where the unpoint() routine is
    being called with the wrong length in cases where the point() routine
    truncated a request.
    
    Signed-off-by: Andy Lowe <alowe at mvista.com>
    Signed-off-by: Nicolas Pitre <nico at cam.org>
    Signed-off-by: David Woodhouse <dwmw2 at infradead.org>
---
 fs/jffs2/erase.c     |    2 +-
 fs/jffs2/readinode.c |    2 +-
 fs/jffs2/scan.c      |    2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index addd3fc..a1db918 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -340,7 +340,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, struct jffs2_erasebl
 		if (retlen < c->sector_size) {
 			/* Don't muck about if it won't let us point to the whole erase sector */
 			D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", retlen));
-			c->mtd->unpoint(c->mtd, ebuf, jeb->offset, c->sector_size);
+			c->mtd->unpoint(c->mtd, ebuf, jeb->offset, retlen);
 			goto do_flash_read;
 		}
 		wordebuf = ebuf-sizeof(*wordebuf);
diff --git a/fs/jffs2/readinode.c b/fs/jffs2/readinode.c
index 8d4319c..2eae5d2 100644
--- a/fs/jffs2/readinode.c
+++ b/fs/jffs2/readinode.c
@@ -65,7 +65,7 @@ static int check_node_data(struct jffs2_sb_info *c, struct jffs2_tmp_dnode_info
 		err = c->mtd->point(c->mtd, ofs, len, &retlen, &buffer);
 		if (!err && retlen < tn->csize) {
 			JFFS2_WARNING("MTD point returned len too short: %zu instead of %u.\n", retlen, tn->csize);
-			c->mtd->unpoint(c->mtd, buffer, ofs, len);
+			c->mtd->unpoint(c->mtd, buffer, ofs, retlen);
 		} else if (err)
 			JFFS2_WARNING("MTD point failed: error code %d.\n", err);
 		else
diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c
index 59dd408..35ef8d8 100644
--- a/fs/jffs2/scan.c
+++ b/fs/jffs2/scan.c
@@ -101,7 +101,7 @@ int jffs2_scan_medium(struct jffs2_sb_info *c)
 		if (!ret && pointlen < c->mtd->size) {
 			/* Don't muck about if it won't let us point to the whole flash */
 			D1(printk(KERN_DEBUG "MTD point returned len too short: 0x%zx\n", pointlen));
-			c->mtd->unpoint(c->mtd, flashbuf, 0, c->mtd->size);
+			c->mtd->unpoint(c->mtd, flashbuf, 0, pointlen);
 			flashbuf = NULL;
 		}
 		if (ret)



More information about the linux-mtd-cvs mailing list