From: Dave Chinner Date: Wed, 11 Jul 2012 21:40:42 +0000 (+1000) Subject: xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near X-Git-Tag: v3.6-rc1~42^2~22 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1f432a887e9a5a5c25be6ac72b5da13652c8bed3;p=platform%2Fkernel%2Flinux-exynos.git xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near The current cursor is reallocated when retrying the allocation, so the existing cursor needs to be destroyed in both the restart and the failure cases. Signed-off-by: Dave Chinner Tested-by: Mike Snitzer Signed-off-by: Ben Myers --- diff --git a/fs/xfs/xfs_alloc.c b/fs/xfs/xfs_alloc.c index 9d1aeb7..f654f51 100644 --- a/fs/xfs/xfs_alloc.c +++ b/fs/xfs/xfs_alloc.c @@ -1074,13 +1074,13 @@ restart: * If we couldn't get anything, give up. */ if (bno_cur_lt == NULL && bno_cur_gt == NULL) { + xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); + if (!forced++) { trace_xfs_alloc_near_busy(args); xfs_log_force(args->mp, XFS_LOG_SYNC); goto restart; } - - xfs_btree_del_cursor(cnt_cur, XFS_BTREE_NOERROR); trace_xfs_alloc_size_neither(args); args->agbno = NULLAGBLOCK; return 0;