[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>
This commit is contained in:
David Chinner 2008-03-06 13:49:43 +11:00 коммит произвёл Lachlan McIlroy
Родитель 92d9cd1059
Коммит 72772a3b5b
1 изменённых файлов: 1 добавлений и 0 удалений

Просмотреть файл

@ -235,6 +235,7 @@ finish_inode:
*/
new_icl = kmem_zone_alloc(xfs_icluster_zone, KM_SLEEP);
if (radix_tree_preload(GFP_KERNEL)) {
xfs_idestroy(ip);
delay(1);
goto again;
}