Commit 431e1eca authored by Felix Radensky's avatar Felix Radensky Committed by David Woodhouse

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: default avatarFelix Radensky <felix@embedded-sol.com>
Signed-off-by: default avatarArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Cc: stable@kernel.org
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent a80f1c1f
...@@ -319,7 +319,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops) ...@@ -319,7 +319,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
if (!(mtd->flags & MTD_WRITEABLE)) if (!(mtd->flags & MTD_WRITEABLE))
return -EROFS; return -EROFS;
ops->retlen = 0; ops->retlen = ops->oobretlen = 0;
for (i = 0; i < concat->num_subdev; i++) { for (i = 0; i < concat->num_subdev; i++) {
struct mtd_info *subdev = concat->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) ...@@ -334,7 +334,7 @@ concat_write_oob(struct mtd_info *mtd, loff_t to, struct mtd_oob_ops *ops)
devops.len = subdev->size - to; devops.len = subdev->size - to;
err = subdev->write_oob(subdev, to, &devops); err = subdev->write_oob(subdev, to, &devops);
ops->retlen += devops.retlen; ops->retlen += devops.oobretlen;
if (err) if (err)
return err; return err;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment