mtd: mtdconcat: fix NAND OOB write

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Tue May 24 21:59:04 EDT 2011


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=431e1ecabddcd7cbba237182ddf431771f98bb4c
Commit:     431e1ecabddcd7cbba237182ddf431771f98bb4c
Parent:     a80f1c1f6a15e4eeba5c146ec9c5c0e12458abc5
Author:     Felix Radensky <felix at embedded-sol.com>
AuthorDate: Mon Apr 25 01:57:12 2011 +0300
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Wed May 25 01:54:50 2011 +0100

    mtd: mtdconcat: fix NAND OOB write
    
    Currently mtdconcat is broken for NAND. An attemtpt to create
    JFFS2 filesystem on concatenation of several NAND devices fails
    with OOB write errors. This patch fixes that problem.
    
    Signed-off-by: Felix Radensky <felix at embedded-sol.com>
    Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
    Cc: stable at kernel.org
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/mtdconcat.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/mtdconcat.c b/drivers/mtd/mtdconcat.c
index 5060e60..e601672 100644
--- a/drivers/mtd/mtdconcat.c
+++ b/drivers/mtd/mtdconcat.c
@@ -319,7 +319,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
 	if (!(mtd->flags & MTD_WRITEABLE))
 		return -EROFS;
 
-	ops->retlen = 0;
+	ops->retlen = ops->oobretlen = 0;
 
 	for (i = 0; i < concat->num_subdev; i++) {
 		struct mtd_info *subdev = concat->subdev[i];
@@ -334,7 +334,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
 			devops.len = subdev->size - to;
 
 		err = subdev->write_oob(subdev, to, &devops);
-		ops->retlen += devops.retlen;
+		ops->retlen += devops.oobretlen;
 		if (err)
 			return err;
 



More information about the linux-mtd-cvs mailing list