Commit 72772a3b5b158cddcfbbff3ef13b26b03a905158

Authored by David Chinner
Committed by Lachlan McIlroy
1 parent 92d9cd1059

[XFS] 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.

SGI-PV: 977823
SGI-Modid: xfs-linux-melb:xfs-kern:30606a

Signed-off-by: David Chinner <dgc@sgi.com>
Signed-off-by: Lachlan McIlroy <lachlan@sgi.com>
Signed-off-by: Christoph Hellwig <hch@infradead.org>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -235,6 +235,7 @@
235 235 */
236 236 new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP);
237 237 if (radix_tree_preload(GFP_KERNEL)) {
  238 + xfs_idestroy(ip);
238 239 delay(1);
239 240 goto again;
240 241 }