JFFS2 deadlock, kernel 3.4.11

Joakim Tjernlund joakim.tjernlund at transmode.se
Thu Oct 4 12:15:46 EDT 2012


Thomas.Betker at rohde-schwarz.com wrote on 2012/10/04 16:20:16:
>
> Hello Joakim,
>
> (sorry if the indentation is wrong, I have not yet found out how to do
> this in Lotus Notes):

Try Reply With Internet-style History (We use Notes here too)

>
> [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.

hmm, are you sure? Did it fail?
As far as I can see jffs2_garbage_collect_live() does this.

>
> 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 ...

don't have time to look ATM

>
> 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
>
> [attachment "jffs2_write_begin.patch" deleted by Joakim Tjernlund/Transmode]




More information about the linux-mtd mailing list