From: Tsutomu Itoh <t-itoh@jp.fujitsu.com>
To: dsterba@suse.cz, linux-btrfs@vger.kernel.org
Subject: Re: [PATCH] Btrfs: add a check of whether fs_info->fs_root is NULL in btrfs_async_reclaim_metadata_space()
Date: Thu, 22 Oct 2015 08:39:35 +0900 [thread overview]
Message-ID: <56282237.5090408@jp.fujitsu.com> (raw)
In-Reply-To: <20151021112742.GD13624@twin.jikos.cz>
On 2015/10/21 20:27, David Sterba wrote:
> On Wed, Oct 21, 2015 at 04:20:00PM +0900, Tsutomu Itoh wrote:
>> Kernel panic occurred due to NULL pointer reference in can_overcommit().
>> Because btrfs_async_reclaim_metadata_space() passed NULL pointer to
>> btrfs_calc_reclaim_metadata_size().
>
>> fs_info->fs_root is referred in btrfs_async_reclaim_metadata_space()
>> when mount kicked kworker(btrfs_async_reclaim_metadata_space).
>>
>> But at this time, fs_info->fs_root had not been initialized yet,
>> so NULL pointer passed to btrfs_calc_reclaim_metadata_size().
>
> I don't think it's the right fix, the initialization sequence should
> take care of such situations. The fs_tree must exist at the time we
> reach the point where it crashed, the code expects it.
OK. I will try to change initialization sequence.
Thanks,
Tsutomu
prev parent reply other threads:[~2015-10-21 23:39 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-21 7:20 [PATCH] Btrfs: add a check of whether fs_info->fs_root is NULL in btrfs_async_reclaim_metadata_space() Tsutomu Itoh
2015-10-21 11:27 ` David Sterba
2015-10-21 23:39 ` Tsutomu Itoh [this message]
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=56282237.5090408@jp.fujitsu.com \
--to=t-itoh@jp.fujitsu.com \
--cc=dsterba@suse.cz \
--cc=linux-btrfs@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.