aboutsummaryrefslogtreecommitdiffstats
path: root/fs/xfs/xfs_iget.c
diff options
context:
space:
mode:
authorDavid Chinner <dgc@sgi.com>2008-03-05 21:49:43 -0500
committerLachlan McIlroy <lachlan@redback.melbourne.sgi.com>2008-03-06 00:38:50 -0500
commit72772a3b5b158cddcfbbff3ef13b26b03a905158 (patch)
treee87303c54834c58dca859c881d693babbf0fce5e /fs/xfs/xfs_iget.c
parent92d9cd1059f80b9c89dee191ffb88b0872e6a7ae (diff)
[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>
Diffstat (limited to 'fs/xfs/xfs_iget.c')
-rw-r--r--fs/xfs/xfs_iget.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fs/xfs/xfs_iget.c b/fs/xfs/xfs_iget.c
index f01b07687faf..8e09b71f4104 100644
--- a/fs/xfs/xfs_iget.c
+++ b/fs/xfs/xfs_iget.c
@@ -235,6 +235,7 @@ finish_inode:
235 */ 235 */
236 new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP); 236 new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP);
237 if (radix_tree_preload(GFP_KERNEL)) { 237 if (radix_tree_preload(GFP_KERNEL)) {
238 xfs_idestroy(ip);
238 delay(1); 239 delay(1);
239 goto again; 240 goto again;
240 } 241 }