linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs: fix dentry leak in simple_fill_super()
@ 2011-11-01 13:12 Konstantin Khlebnikov
  2011-11-01 23:37 ` Jan Kara
  0 siblings, 1 reply; 2+ messages in thread
From: Konstantin Khlebnikov @ 2011-11-01 13:12 UTC (permalink / raw)
  To: Alexander Viro; +Cc: linux-fsdevel, linux-kernel, devel

put dentry if inode allocation failed, d_genocide() cannot release it

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;

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] fs: fix dentry leak in simple_fill_super()
  2011-11-01 13:12 [PATCH] fs: fix dentry leak in simple_fill_super() Konstantin Khlebnikov
@ 2011-11-01 23:37 ` Jan Kara
  0 siblings, 0 replies; 2+ messages in thread
From: Jan Kara @ 2011-11-01 23:37 UTC (permalink / raw)
  To: Konstantin Khlebnikov
  Cc: Alexander Viro, linux-fsdevel, linux-kernel, devel,
	Christoph Hellwig

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-11-01 23:37 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-11-01 13:12 [PATCH] fs: fix dentry leak in simple_fill_super() Konstantin Khlebnikov
2011-11-01 23:37 ` Jan Kara

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).