aboutsummaryrefslogtreecommitdiffstats
path: root/fs/jffs2
diff options
context:
space:
mode:
authorJoakim Tjernlund <Joakim.Tjernlund@transmode.se>2009-05-28 11:43:59 -0400
committerDavid Woodhouse <David.Woodhouse@intel.com>2009-05-29 05:44:46 -0400
commit81e2962801bbb4e740c501ca687d5cb857929c04 (patch)
tree59b7eabd1477825c48278956a9a9a387ee92d12b /fs/jffs2
parent8541c1180a355c4da283fc6b03a92c0233823c1b (diff)
jffs2: Fix corruption when flash erase/write failure
Erase errors such as: "Newly-erased block contained word 0xa4ef223e at offset 0x0296a014" and failure to write the clean marker, moves the offending erase block to erasing list before calling jffs2_erase_failed(). This is bad as jffs2_erase_failed() will also move the block to the bad_list, but is now moving the wrong block, causing FS corruption. Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Diffstat (limited to 'fs/jffs2')
-rw-r--r--fs/jffs2/erase.c7
1 files changed, 0 insertions, 7 deletions
diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index c32b4a1ad6cf..a0244740b75a 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -480,13 +480,6 @@ static void jffs2_mark_erased_block(struct jffs2_sb_info *c, struct jffs2_eraseb
480 return; 480 return;
481 481
482filebad: 482filebad:
483 mutex_lock(&c->erase_free_sem);
484 spin_lock(&c->erase_completion_lock);
485 /* Stick it on a list (any list) so erase_failed can take it
486 right off again. Silly, but shouldn't happen often. */
487 list_move(&jeb->list, &c->erasing_list);
488 spin_unlock(&c->erase_completion_lock);
489 mutex_unlock(&c->erase_free_sem);
490 jffs2_erase_failed(c, jeb, bad_offset); 483 jffs2_erase_failed(c, jeb, bad_offset);
491 return; 484 return;
492 485