OpenVZ Forum


Home » Mailing lists » Devel » Re: [PATCH] fs: fix dentry leak in simple_fill_super()
Re: [PATCH] fs: fix dentry leak in simple_fill_super() [message #43942] Tue, 01 November 2011 23:37
Jan Kara is currently offline  Jan Kara
Messages: 13
Registered: July 2007
Junior Member
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
Previous Topic: [PATCH] SUNRPC: remove non-exclusive pipe creation from RPC pipefs
Next Topic: [PATCH v2] bridge: Reset IPCB on forward non-local packets in br_handle_frame_finish()
Goto Forum:
  


Current Time: Tue Mar 19 05:52:48 GMT 2024

Total time taken to generate the page: 0.02421 seconds