lkml.org 
[lkml]   [2013]   [Jun]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] btrfs: Drop inode if inode root is NULL
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)
>



\
 
 \ /
  Last update: 2013-06-06 13:21    [W:0.020 / U:6.964 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site