fix inode leak in xfs_iget_core()
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
@@ -232,6 +232,7 @@ finish_inode:* write spinlock. */ if (radix_tree_preload (GFP_KERNEL )) { +xfs_idestroy (ip);delay (1 ); goto again; }
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 leakxfs_vnodestructures 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 :)
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 leakxfs_vnodestructures 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?