All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Myers <bpm@sgi.com>
To: xfs@oss.sgi.com
Cc: Al Viro <viro@zeniv.linux.org.uk>
Subject: [PATCH] xfs: don't leak root inode reference
Date: Mon, 26 Aug 2013 15:47:30 -0500	[thread overview]
Message-ID: <20130826204730.GZ7153@sgi.com> (raw)

Looks like in 48fde701 we removed the iput of the root inode in
xfs_fs_fill_super for the error case.  Add it back.

Signed-off-by: Ben Myers <bpm@sgi.com>

---
 fs/xfs/xfs_super.c |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

Index: b/fs/xfs/xfs_super.c
===================================================================
--- a/fs/xfs/xfs_super.c	2013-08-26 15:36:09.170848579 -0500
+++ b/fs/xfs/xfs_super.c	2013-08-26 15:40:19.450817933 -0500
@@ -1493,12 +1493,12 @@ xfs_fs_fill_super(
 	}
 	if (is_bad_inode(root)) {
 		error = EINVAL;
-		goto out_unmount;
+		goto out_iput;
 	}
 	sb->s_root = d_make_root(root);
 	if (!sb->s_root) {
 		error = ENOMEM;
-		goto out_unmount;
+		goto out_iput;
 	}
 
 	return 0;
@@ -1519,6 +1519,8 @@ out_destroy_workqueues:
  out:
 	return -error;
 
+ out_iput:
+	iput(root);
  out_unmount:
 	xfs_filestream_unmount(mp);
 	xfs_unmountfs(mp);

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

             reply	other threads:[~2013-08-26 20:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-26 20:47 Ben Myers [this message]
2013-08-26 21:03 ` [PATCH] xfs: don't leak root inode reference Al Viro
2013-08-26 21:24 ` Dave Chinner
2013-08-27 21:25   ` [PATCH v2] " Ben Myers
2013-08-27 22:08     ` Dave Chinner
2013-09-10 23:11       ` Ben Myers
2013-09-18  3:13         ` Dave Chinner
2013-10-01 22:40         ` Ben Myers

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=20130826204730.GZ7153@sgi.com \
    --to=bpm@sgi.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=xfs@oss.sgi.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.