login
Header Space

 
 

Re: JFFS2: BUG: sleeping function called from invalid context

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Adrian Hunter <ext-adrian.hunter@...>
Cc: <linux-mtd@...>, <linux-kernel@...>, David Woodhouse <dwmw2@...>
Date: Tuesday, March 20, 2007 - 2:01 pm

On Tue, 2007-03-20 at 12:51 +0200, Adrian Hunter wrote:

This function seems to be completely broken. JFF2 calls iget() while
holding c->erase_completion_lock spinlock. This is one problem. Iget can
sleep.

The other one is that JFFS2 calls jffs2_gc_fetch_inode() while holding
c->alloc_sem and c->wbuf_sem semaphores. What happens if JFFS2 races
with pdflush, and pdflush wins, clears inode, then VFS calls
read_inode() to satisfy JFFS2's iget() request. It is a _deadlock_
because the in read_inode JFFS2 will try to lock the above semaphores
again.

The wbuf recovery function has to be re-worked or just disabled -
because returning error is better then fall into a deadlock.

David,
comments, ideas?

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

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
JFFS2: BUG: sleeping function called from invalid context, Adrian Hunter, (Tue Mar 20, 6:51 am)
Re: JFFS2: BUG: sleeping function called from invalid context, Artem Bityutskiy, (Tue Mar 20, 2:01 pm)
speck-geostationary