Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=74641d75275936796d239f828b80cb030e9f9b0a
Commit:     74641d75275936796d239f828b80cb030e9f9b0a
Parent:     f8a922c7bb4d93bd84b7371a8e2571e667d2afb5
Author:     Adrian Hunter <[EMAIL PROTECTED]>
AuthorDate: Thu Mar 8 12:20:12 2007 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Thu Mar 8 10:45:04 2007 +0000

    [MTD] Correct partition failed erase address
    
    If an erase operation fails, the address at which the
    failure occurred is returned by the driver.  The MTD
    partition must adjust this address (by subtracting the
    partition offset) before returning to the caller.
    This was not happening, which caused JFFS2 to mark
    the wrong block bad!
    
    Signed-off-by: Adrian Hunter <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 drivers/mtd/mtdpart.c |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/drivers/mtd/mtdpart.c b/drivers/mtd/mtdpart.c
index 01e4aff..1af9890 100644
--- a/drivers/mtd/mtdpart.c
+++ b/drivers/mtd/mtdpart.c
@@ -200,6 +200,11 @@ static int part_erase (struct mtd_info *mtd, struct 
erase_info *instr)
                return -EINVAL;
        instr->addr += part->offset;
        ret = part->master->erase(part->master, instr);
+       if (ret) {
+               if (instr->fail_addr != 0xffffffff)
+                       instr->fail_addr -= part->offset;
+               instr->addr -= part->offset;
+       }
        return ret;
 }
 
@@ -560,4 +565,3 @@ EXPORT_SYMBOL_GPL(deregister_mtd_parser);
 MODULE_LICENSE("GPL");
 MODULE_AUTHOR("Nicolas Pitre <[EMAIL PROTECTED]>");
 MODULE_DESCRIPTION("Generic support for partitioning of MTD devices");
-
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to