From: Dave Chinner Date: Tue, 12 Jun 2012 04:20:26 +0000 (+1000) Subject: xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near X-Git-Tag: v3.6-rc1~42^2~36 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=079da28c64ebeca357adae77aea3ae7160e45d98;p=platform%2Fkernel%2Flinux-exynos.git xfs: fix allocbt cursor leak in xfs_alloc_ag_vextent_near When we fail to find an matching extent near the requested extent specification during a left-right distance search in xfs_alloc_ag_vextent_near, we fail to free the original cursor that we used to look up the XFS_BTNUM_CNT tree and hence leak it. Reported-by: Chris J Arges Signed-off-by: Dave Chinner Reviewed-by: Christoph Hellwig Signed-off-by: Ben Myers --- diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index a996e39..9d1aeb7 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c @@ -1080,6 +1080,7 @@ restart: goto restart; } + xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); trace_xfs_alloc_size_neither(args); args->agbno = NULLAGBLOCK; return 0;