public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs: don't leak root inode reference
@ 2013-08-26 20:47 Ben Myers
  2013-08-26 21:03 ` Al Viro
  2013-08-26 21:24 ` Dave Chinner
  0 siblings, 2 replies; 8+ messages in thread
From: Ben Myers @ 2013-08-26 20:47 UTC (permalink / raw)
  To: xfs; +Cc: Al Viro

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

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

end of thread, other threads:[~2013-10-01 22:40 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-26 20:47 [PATCH] xfs: don't leak root inode reference Ben Myers
2013-08-26 21:03 ` 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox