Re: JFFS2 oops when writing to two partitions simultaneously

Orjan Friberg
2012-01-26T16:05:24Z

On 01/26/2012 04:25 PM, Orjan Friberg wrote:
> On 01/26/2012 04:17 PM, Joakim Tjernlund wrote:
>> You could try removing the lock dropping, one at a time, to see if it makes a difference.
>> That would be a data point for anyone wanting to fix this.
>
> I'll turn on CONFIG_DEBUG_SPINLOCK and CONFIG_DEBUG_SPINLOCK_SLEEP and
> see what happens.

As expected, dropping the lock around kmalloc was fine once I changed
GFP_KERNEL to GFP_ATOMIC.

Dropping the lock around kfree worked fine (I didn't think it would).

And, as you suggested, we could probably combine those.

We must hold the lock when calling this->compress (to protect compr_buf;
we oops without it) but in doing so I get

BUG: sleeping function called from invalid context at kernel/mutex.c:85

because jffs2_lzo_compress does a mutex_lock.

Even if it did work, I think we'd unneccessarily be limiting the
throughput in that piece of code by holding the lock for that long.