linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Konstantin Khlebnikov <khlebnikov@openvz.org>
Cc: Alexander Viro <viro@zeniv.linux.org.uk>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	devel@openvz.org, Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH] fs: fix dentry leak in simple_fill_super()
Date: Wed, 2 Nov 2011 00:37:08 +0100	[thread overview]
Message-ID: <20111101233708.GK18701@quack.suse.cz> (raw)
In-Reply-To: <20111101121233.15505.87415.stgit@zurg>

On Tue 01-11-11 16:12:33, Konstantin Khlebnikov wrote:
> put dentry if inode allocation failed, d_genocide() cannot release it
  Al is currently ill and Christoph Hellwig is taking care of fixes for
now. Added him to CC...

								Honza

> 
> Signed-off-by: Konstantin Khlebnikov <khlebnikov@openvz.org>
> ---
>  fs/libfs.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/fs/libfs.c b/fs/libfs.c
> index c18e9a1..a2c0029 100644
> --- a/fs/libfs.c
> +++ b/fs/libfs.c
> @@ -510,8 +510,10 @@ int simple_fill_super(struct super_block *s, unsigned long magic,
>  		if (!dentry)
>  			goto out;
>  		inode = new_inode(s);
> -		if (!inode)
> +		if (!inode) {
> +			dput(dentry);
>  			goto out;
> +		}
>  		inode->i_mode = S_IFREG | files->mode;
>  		inode->i_atime = inode->i_mtime = inode->i_ctime = CURRENT_TIME;
>  		inode->i_fop = files->ops;
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-fsdevel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

      reply	other threads:[~2011-11-01 23:37 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-01 13:12 [PATCH] fs: fix dentry leak in simple_fill_super() Konstantin Khlebnikov
2011-11-01 23:37 ` Jan Kara [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=20111101233708.GK18701@quack.suse.cz \
    --to=jack@suse.cz \
    --cc=devel@openvz.org \
    --cc=hch@infradead.org \
    --cc=khlebnikov@openvz.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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).