xfs
[Top] [All Lists]

Re: [PATCH] xfs: don't leak root inode reference

To: Ben Myers <bpm@xxxxxxx>
Subject: Re: [PATCH] xfs: don't leak root inode reference
From: Al Viro <viro@xxxxxxxxxxxxxxxxxx>
Date: Mon, 26 Aug 2013 22:03:32 +0100
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <20130826204730.GZ7153@xxxxxxx>
References: <20130826204730.GZ7153@xxxxxxx>
Sender: Al Viro <viro@xxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Mon, Aug 26, 2013 at 03:47:30PM -0500, Ben Myers wrote:
> Looks like in 48fde701 we removed the iput of the root inode in
> xfs_fs_fill_super for the error case.  Add it back.
>       if (is_bad_inode(root)) {
>               error = EINVAL;
> -             goto out_unmount;
> +             goto out_iput;

This one makes sense

>       }
>       sb->s_root = d_make_root(root);
>       if (!sb->s_root) {
>               error = ENOMEM;
> -             goto out_unmount;
> +             goto out_iput;


... this one, OTOH, is simply wrong - take a look at what d_make_root()
does on failure.

<Prev in Thread] Current Thread [Next in Thread>