Patchwork nftl: write support is broken

login
register
mail settings
Submitter dimitri.gorokhovik@free.fr
Date Aug. 18, 2009, 9:10 p.m.
Message ID <25767218.3393441250629814335.JavaMail.root@zimbra3-e1.priv.proxad.net>
Download mbox | patch
Permalink /patch/31588/
State Accepted
Commit 4149ed1aa944ab864024982a2e568d17eccff504
Headers show

Comments

dimitri.gorokhovik@free.fr - Aug. 18, 2009, 9:10 p.m.
Write support is broken in NFTL. Fix it.

Signed-off-by: <dimitri.gorokhovik@free.fr>

---

Patch

diff --git a/drivers/mtd/nftlcore.c b/drivers/mtd/nftlcore.c
index fb86cac..665d3eb 100644
--- a/drivers/mtd/nftlcore.c
+++ b/drivers/mtd/nftlcore.c
@@ -181,7 +181,7 @@  static int nftl_write(struct mtd_info *mtd, loff_t offs, size_t len,
 	int res;
 
 	ops.mode = MTD_OOB_PLACE;
-	ops.ooboffs = offs;
+	ops.ooboffs = offs & (mtd->writesize - 1);
 	ops.ooblen = mtd->oobsize;
 	ops.oobbuf = oob;
 	ops.datbuf = buf;