mtd: nftl: write support is broken

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Thu Sep 3 11:59:01 EDT 2009


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=4149ed1aa944ab864024982a2e568d17eccff504
Commit:     4149ed1aa944ab864024982a2e568d17eccff504
Parent:     edcb3b14863e1a6aa1923eeaa81125a00cf51a80
Author:     Dimitri Gorokhovik <dimitri.gorokhovik at free.fr>
AuthorDate: Thu Sep 3 14:59:13 2009 +0100
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Thu Sep 3 14:59:13 2009 +0100

    mtd: nftl: write support is broken
    
    Write support is broken in NFTL. Fix it.
    
    Signed-off-by: <dimitri.gorokhovik at free.fr>
    Cc: Tim Gardner <tim.gardner at canonical.com>
    Cc: Scott James Remnant <scott at canonical.com>
    Signed-off-by: Andrew Morton <akpm at linux-foundation.org>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/nftlcore.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

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;



More information about the linux-mtd-cvs mailing list