From: Michael Lyle <mlyle@lyle.org>
To: Coly Li <i@coly.li>
Cc: Sverd Johnsen <sverd.johnsen@googlemail.com>,
linux-bcache@vger.kernel.org
Subject: Re: Comm: bcache_allocato BUG: unable to handle kernel NULL pointer dereference at 00000000000006bc
Date: Sat, 14 Oct 2017 15:34:46 -0700 [thread overview]
Message-ID: <9cfdd5d4-0956-2c51-e30e-e76fb2276ec7@lyle.org> (raw)
In-Reply-To: <f4f81939-723a-b130-7d72-b9e4f194d604@coly.li>
On 10/14/2017 03:02 PM, Coly Li wrote:
[snip]
Hey Coly,--
My bad: I misread the trace and your commit log. This makes more sense.
Does this re-ordering also prevent the other alloc_thread issue from
being triggered?
I feel like we should maybe be holding a big lock that excludes sysfs
actions during these critical times-- maybe make the register_lock
bigger-- so that it is not as critical to handle these dependencies. It
will be a little less responsive/concurrent during registration but this
is just a boot-time or shutdown issue, so...
Mike
> Hi Mike,
>
> I check the code, creating sysfs obj has no obvious logic change in the
> code. And I ran a test for this change, just echo 1 into stop files and
> re-register cache/cached devices by bash script.
>
> The dmesg output displays,
> [ 5646.739946] bcache: bch_journal_replay() journal replay done, 3406
> keys in 8 entries, seq 15762
> [ 5646.740120] bcache: register_cache() registered cache device nvme1n1p1
> [ 5647.074204] bcache: register_bdev() registered backing device md0
> [ 5647.145510] bcache: bch_cached_dev_attach() Caching md0 as bcache0 on
> set 76abb9d9-aea3-4e1a-9b4a-46a217963834
> [ 5664.285232] bcache: bcache_device_free() bcache0 stopped
> [ 5664.322575] bcache: cache_set_free() Cache set
> 76abb9d9-aea3-4e1a-9b4a-46a217963834 unregistered
> [ 5674.928248] bcache: bch_journal_replay() journal replay done, 4063
> keys in 11 entries, seq 15859
> [ 5674.928413] bcache: register_cache() registered cache device nvme1n1p1
> [ 5675.257664] bcache: register_bdev() registered backing device md0
> [ 5675.347494] bcache: bch_cached_dev_attach() Caching md0 as bcache0 on
> set 76abb9d9-aea3-4e1a-9b4a-46a217963834
> [ 5692.665452] bcache: bcache_device_free() bcache0 stopped
>
> I ran the test for a while, it seems nothing broken. Then I post out
> this draft version.
>
>> Isn't this reported issue is the thing that you fixed earlier in
>> "bcache: check ca->alloc_thread initialized before wake up it" ?
>>
>
> They are different NULL dereference locations, my previous fix is a NULL
> dereference when waking up allocator thread, this one is a NULL
> dereference on data bucket spinlock.
>
> This NULL spinlock is a little bit complex, I don't find a proper way to
> handle caller's logic where data bucket spinlock is referenced, so I
> change the function calling order to make sure it has been initialized
> before any further reference.
>
>> It seems like we have a lot of issues with bringing up devices and
>> tearing them down/detaching.
>
> Yes, if you look at Liang Chen's patch "bcache: explicitly destroy mutex
> while exiting", you may find he moves sysfs_create_files(bcache_kobj,
> files)) after bch_request_init() for the similar reason.
>
next prev parent reply other threads:[~2017-10-14 22:34 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-14 11:14 Comm: bcache_allocato BUG: unable to handle kernel NULL pointer dereference at 00000000000006bc Sverd Johnsen
2017-10-14 11:42 ` Coly Li
2017-10-14 12:04 ` Sverd Johnsen
2017-10-14 16:22 ` Coly Li
2017-10-14 21:23 ` Michael Lyle
2017-10-14 22:02 ` Coly Li
2017-10-14 22:34 ` Michael Lyle [this message]
2017-10-15 10:27 ` Coly Li
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=9cfdd5d4-0956-2c51-e30e-e76fb2276ec7@lyle.org \
--to=mlyle@lyle.org \
--cc=i@coly.li \
--cc=linux-bcache@vger.kernel.org \
--cc=sverd.johnsen@googlemail.com \
/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