diff mbox

nftl: write support is broken

Message ID 25767218.3393441250629814335.JavaMail.root@zimbra3-e1.priv.proxad.net
State Accepted
Commit 4149ed1aa944ab864024982a2e568d17eccff504
Headers show

Commit Message

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

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

---
diff mbox

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;