[PATCH] JFFS2: fix deadlock on error path

Artem Bityutskiy dedekind at infradead.org
Sat Mar 17 06:48:50 EDT 2007


On Tue, 2007-03-13 at 14:19 +0200, Artem Bityutskiy wrote:
> From: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>
> Subject: [PATCH] JFFS2: fix deadlock on error path
> 
> When the MTD driver returns write failure, the following deadlock
> occures:
> 
> 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 <ext-adrian.hunter at nokia.com>
> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy at nokia.com>

David,

please, send this patch to Linus as it is critical enough.

-- 
Best regards,
Artem Bityutskiy (Битюцкий Артём)





More information about the linux-mtd mailing list