JFFS2 deadlock, kernel 3.4.11

Thomas.Betker at rohde-schwarz.com Thomas.Betker at rohde-schwarz.com
Thu Oct 4 10:20:16 EDT 2012


Hello Joakim,

(sorry if the indentation is wrong, I have not yet found out how to do 
this in Lotus Notes):

[Joakim Tjernlund]
So maybe this will help(not even compile tested), don't know if 
jffs2_reserve_space()
can be called with f->sem held.
If this is bad, then perhaps move pg = 
grab_cache_page_write_begin(mapping, index, flags)
to later in this function somehow?
[/Joakim Tjernlund]

jffs2_reserve_space() must not be called with f->sem held because it 
acquires c->alloc_sem.

So I have moved mutex_lock(&f->sem) and grab_cache_page_write_begin() 
after jffs2_reserve_space(). Attached is my 3.4.11 patch (which is based 
on your patch) for review; I hope it is not mangled by Lotus Notes ...

The first tests (with proof of locking correctness enabled) were fine. The 
main tests will run until tomorrow evening, though; last time, it took me 
all day to reproduce the deadlock, and I want to be reasonably sure that 
it is gone -- and that no new deadlocks were introduced.

Best regards,
Thomas

-------------- next part --------------
A non-text attachment was scrubbed...
Name: jffs2_write_begin.patch
Type: application/octet-stream
Size: 2123 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-mtd/attachments/20121004/ada43f3b/attachment.obj>


More information about the linux-mtd mailing list