From: Richard Weinberger <richard@nod.at>
To: Jia-Ju Bai <baijiaju1990@163.com>, dedekind1@gmail.com
Cc: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ubifs: Fix a sleep-in-atomic bug in ubifs_read_nnode
Date: Mon, 5 Jun 2017 10:39:37 +0200 [thread overview]
Message-ID: <cb1e1f5d-5efc-e928-c962-02a5b772cc83@nod.at> (raw)
In-Reply-To: <0687ba2f-f7d5-4632-eebb-50bbadd8a4b0@nod.at>
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
next prev parent reply other threads:[~2017-06-05 8:39 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-05 3:38 Jia-Ju Bai
2017-06-05 8:25 ` Richard Weinberger
2017-06-05 8:39 ` Richard Weinberger [this message]
2017-06-05 8:43 ` Jia-Ju Bai
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cb1e1f5d-5efc-e928-c962-02a5b772cc83@nod.at \
--to=richard@nod.at \
--cc=baijiaju1990@163.com \
--cc=dedekind1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®