Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=b0afbbec4981417f79e05865a36e57abfc289002
Commit:     b0afbbec4981417f79e05865a36e57abfc289002
Parent:     4226b510371efd9cdc628663527d36aee36054a9
Author:     Artem Bityutskiy <[EMAIL PROTECTED]>
AuthorDate: Wed Mar 21 11:07:05 2007 +0200
Committer:  David Woodhouse <[EMAIL PROTECTED]>
CommitDate: Tue Apr 17 13:53:51 2007 -0400

    [JFFS2] fix deadlock on error path
    
    When the MTD driver returns write failure, the following deadlock
    occurs:
    
    We are in __jffs2_flush_wbuf(), we hold &c->wbuf_sem. Write failure.
    jffs2_wbuf_recover()->jffs2_reserve_space_gc()->jffs2_do_reserve_space()
    ->jffs2_erase_pending_blocks()->jffs2_flash_read()
    
    and it tries to lock &c->wbuf_sem again. Deadlock.
    
    Reported-by: Adrian Hunter <[EMAIL PROTECTED]>
    Signed-off-by: Artem Bityutskiy <[EMAIL PROTECTED]>
    Signed-off-by: David Woodhouse <[EMAIL PROTECTED]>
---
 fs/jffs2/erase.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/jffs2/erase.c b/fs/jffs2/erase.c
index ad01210..6b1f7be 100644
--- a/fs/jffs2/erase.c
+++ b/fs/jffs2/erase.c
@@ -333,7 +333,7 @@ static int jffs2_block_check_erase(struct jffs2_sb_info *c, 
struct jffs2_erasebl
 
                *bad_offset = ofs;
 
-               ret = jffs2_flash_read(c, ofs, readlen, &retlen, ebuf);
+               ret = c->mtd->read(c->mtd, ofs, readlen, &retlen, ebuf);
                if (ret) {
                        printk(KERN_WARNING "Read of newly-erased block at 
0x%08x failed: %d. Putting on bad_list\n", ofs, ret);
                        goto fail;
-
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