lkml.org 
[lkml]   [2017]   [Jun]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] ubifs: Fix a sleep-in-atomic bug in ubifs_read_nnode
From
Date
Am 05.06.2017 um 10:25 schrieb Richard Weinberger:
> Jia-Ju Bai,
>
> Am 05.06.2017 um 05:38 schrieb Jia-Ju Bai:
>> The driver may sleep under a spin lock, and the function call path is:
>> ubifs_change_lp (acquire the lock by spin_lock)
>> change_category
>> ubifs_remove_from_cat
>> remove_from_lpt_heap
>> dbg_check_heap
>> ubifs_lpt_lookup
>> ubifs_read_nnode
>> kzalloc(GFP_NOFS) --> may sleep
>>
>> To fix it, "GFP_NOFS" is replaced with "GFP_ATOMIC".
>
> So, this happens only when dbg_check_heap() is activated, right?

Why do we call change_category() anyway with c->space_lock held?

Thanks,
//richard

\
 
 \ /
  Last update: 2017-06-05 11:36    [W:2.380 / U:0.720 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site