xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near
authorDave Chinner <dchinner@redhat.com>
Wed, 11 Jul 2012 21:40:42 +0000 (07:40 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Aug 2014 17:07:40 +0000 (18:07 +0100)
commitd9892580a2f3aa0d369fcec9bd50fd75ecc57dcc
treea6382b3981f9d252188887fcd875edc6d25459c0
parent381687bd230ca824df7a70aa1f8fa3a4345ee6e2
xfs: really fix the cursor leak in xfs_alloc_ag_vextent_near

commit e3a746f5aab71f2dd0a83116772922fb37ae29d6 upstream.

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 <dchinner@redhat.com>
Tested-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Ben Myers <bpm@sgi.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
fs/xfs/xfs_alloc.c