Skip to contentSkip to conversation

fix inode leak in xfs_iget_core()

PATCH In review David Chinner 2 participants 3 messages Feb 23, 2008 – Mar 3, 2008 XFS filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix inode leak in xfs_iget_core()

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.

---
 fs/xfs/xfs_iget.c |    1 +
 1 file changed, 1 insertion(+)
fs/xfs/xfs_iget.c +1 -0
Index: 2.6.x-xfs-new/fs/xfs/xfs_iget.c
===================================================================
@@ -232,6 +232,7 @@ finish_inode:
 	 * write spinlock.
 	 */
 	if (radix_tree_preload(GFP_KERNEL)) {
+		xfs_idestroy(ip);
 		delay(1);
 		goto again;
 	}
#1 lore raw
Quoted 4 lines · David Chinner

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.

What we're leaking would be the xfs_inode. But this is exactly the patch I had so OK from me :)

#2 lore raw
Quoted 8 lines · Christoph Hellwig
Quoted 4 lines · David Chinner

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.

What we're leaking would be the xfs_inode. But this is exactly the patch I had so OK from me :)

Now that you're hopefully safe home can you commit it and push it for .25?