From: Miao Xie <miaox@cn.fujitsu.com>
To: naota@elisp.net
Cc: Chris Mason <chris.mason@fusionio.com>,
linux-btrfs@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] btrfs: Drop inode if inode root is NULL
Date: Thu, 06 Jun 2013 18:13:53 +0800 [thread overview]
Message-ID: <51B060E1.7050509@cn.fujitsu.com> (raw)
In-Reply-To: <87bo7jh8a5.fsf@elisp.net>
On thu, 06 Jun 2013 18:56:34 +0900, naota@elisp.net wrote:
> There is a path where btrfs_drop_inode() is called with its inode's root
> is NULL: In btrfs_new_inode(), when btrfs_set_inode_index() fails,
> iput() is called. We should handle this case before taking look at the
> root->root_item.
>
> Signed-off-by: Naohiro Aota <naota@elisp.net>
Reviewed-by: Miao Xie <miaox@cn.fujitsu.com>
> ---
> fs/btrfs/inode.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/fs/btrfs/inode.c b/fs/btrfs/inode.c
> index af978f7..17f3064 100644
> --- a/fs/btrfs/inode.c
> +++ b/fs/btrfs/inode.c
> @@ -8012,6 +8012,9 @@ int btrfs_drop_inode(struct inode *inode)
> {
> struct btrfs_root *root = BTRFS_I(inode)->root;
>
> + if (root == NULL)
> + return 1;
> +
> /* the snap/subvol tree is on deleting */
> if (btrfs_root_refs(&root->root_item) == 0 &&
> root != root->fs_info->tree_root)
>
prev parent reply other threads:[~2013-06-06 10:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-06-06 9:56 [PATCH] btrfs: Drop inode if inode root is NULL naota
2013-06-06 10:13 ` Miao Xie [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=51B060E1.7050509@cn.fujitsu.com \
--to=miaox@cn.fujitsu.com \
--cc=chris.mason@fusionio.com \
--cc=linux-btrfs@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=naota@elisp.net \
/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