public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] fix inode leak in xfs_iget_core()
@ 2008-02-23  6:19 David Chinner
  2008-02-23  9:22 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: David Chinner @ 2008-02-23  6:19 UTC (permalink / raw)
  To: xfs-dev; +Cc: xfs-oss

If the radix_tree_preload() fails, we need to destroy the
inode we just read in before trying again. This could leak
xfs_vnode structures when there is memory pressure. Noticed
by Christoph Hellwig.

Signed-off-by: Dave Chinner <dgc@sgi.com>
---
 fs/xfs/xfs_iget.c |    1 +
 1 file changed, 1 insertion(+)

Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c
===================================================================
--- 2.6.x-xfs-new.orig/fs/xfs/xfs_iget.c	2008-02-15 19:27:02.000000000 +1100
+++ 2.6.x-xfs-new/fs/xfs/xfs_iget.c	2008-02-23 16:51:31.602711856 +1100
@@ -232,6 +232,7 @@ finish_inode:
 	 * write spinlock.
 	 */
 	if (radix_tree_preload(GFP_KERNEL)) {
+		xfs_idestroy(ip);
 		delay(1);
 		goto again;
 	}

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

end of thread, other threads:[~2008-03-03  4:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-23  6:19 [patch] fix inode leak in xfs_iget_core() David Chinner
2008-02-23  9:22 ` Christoph Hellwig
2008-03-03  4:04   ` Christoph Hellwig

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