mtd: nftl: write support is broken
authorDimitri Gorokhovik <dimitri.gorokhovik@free.fr>
Thu, 3 Sep 2009 13:59:13 +0000 (14:59 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Thu, 3 Sep 2009 13:59:13 +0000 (14:59 +0100)
Write support is broken in NFTL. Fix it.

Signed-off-by: <dimitri.gorokhovik@free.fr>
Cc: Tim Gardner <tim.gardner@canonical.com>
Cc: Scott James Remnant <scott@canonical.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
drivers/mtd/nftlcore.c

index fb86cac..665d3eb 100644 (file)
@@ -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;