From: Josef Bacik <josef@toxicpanda.com>
To: Nikolay Borisov <nborisov@suse.com>,
linux-btrfs@vger.kernel.org, kernel-team@fb.com
Subject: Re: [PATCH 1/4] btrfs: set fs_root = NULL on error
Date: Thu, 13 Feb 2020 10:31:23 -0500 [thread overview]
Message-ID: <ca02dd70-3332-14e4-0719-09f75cad499a@toxicpanda.com> (raw)
In-Reply-To: <e1ec6363-0b6e-bfbb-5fde-f2824d758d20@suse.com>
On 2/13/20 5:48 AM, Nikolay Borisov wrote:
>
>
> On 11.02.20 г. 23:40 ч., Josef Bacik wrote:
>> While running my error injection script I hit a panic when we tried to
>> clean up the fs_root when free'ing the fs_root. This is because
>> fs_info->fs_root == PTR_ERR(-EIO), which isn't great. Fix this by
>> setting fs_info->fs_root = NULL; if we fail to read the root.
>>
>> Signed-off-by: Josef Bacik <josef@toxicpanda.com>
>
>
> While looking to see how ->fs_root (git grep "\->fs_root\W" fs/btrfs) is
> used I realized we almost never query it through that member. It's
> cleaned up via the btrfs_free_fs_roots which queries the root radix.
> Given this I fail to see how the presence of a bogus value in
> fs_info->fs_root would cause a crash (it's certainly wrong so your patch
> per-se is fine). Can you provide an example call trace?
>
We do a btrfs_put_root(fs_info->fs_root); in btrfs_free_fs_info. There's for
sure an argument to be made for getting rid of fs_info->fs_root, and just using
the radix lookup. Once all of my root ref patches are merged I'll take a run at
that. Thanks,
Josef
next prev parent reply other threads:[~2020-02-13 15:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-11 21:40 [PATCH 0/4] Error condition failure fixes Josef Bacik
2020-02-11 21:40 ` [PATCH 1/4] btrfs: set fs_root = NULL on error Josef Bacik
2020-02-12 0:55 ` Qu Wenruo
2020-02-13 10:05 ` Johannes Thumshirn
2020-02-13 10:48 ` Nikolay Borisov
2020-02-13 15:31 ` Josef Bacik [this message]
2020-02-13 15:32 ` Nikolay Borisov
2020-02-11 21:40 ` [PATCH 2/4] btrfs: do not check delayed items are empty for single trans cleanup Josef Bacik
2020-02-12 0:57 ` Qu Wenruo
2020-02-13 10:28 ` Nikolay Borisov
2020-02-13 11:15 ` Johannes Thumshirn
2020-02-11 21:40 ` [PATCH 3/4] btrfs: handle logged extent failure properly Josef Bacik
2020-02-12 0:58 ` Qu Wenruo
2020-02-13 10:26 ` Nikolay Borisov
2020-02-13 11:16 ` Johannes Thumshirn
2020-02-11 21:40 ` [PATCH 4/4] btrfs: fix bytes_may_use underflow in prealloc error condtition Josef Bacik
2020-02-12 1:00 ` Qu Wenruo
2020-02-13 10:17 ` Nikolay Borisov
2020-02-13 15:29 ` Josef Bacik
2020-02-13 15:47 [PATCH 0/4][v2] Error condition failure fixes Josef Bacik
2020-02-13 15:47 ` [PATCH 1/4] btrfs: set fs_root = NULL on error Josef Bacik
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=ca02dd70-3332-14e4-0719-09f75cad499a@toxicpanda.com \
--to=josef@toxicpanda.com \
--cc=kernel-team@fb.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=nborisov@suse.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;
as well as URLs for NNTP newsgroup(s).