]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commit
xfs: add missing bmap cancel calls in error paths
authorBrian Foster <bfoster@redhat.com>
Mon, 15 Feb 2016 01:13:38 +0000 (12:13 +1100)
committerDave Chinner <david@fromorbit.com>
Mon, 15 Feb 2016 01:13:38 +0000 (12:13 +1100)
commit5769a376f40e73cba253189731d03c076a752603
treee75cfdf636353607ded5d22de52e614862e2666d
parentc5c9f532f8f577ffd03b83b2412a4c4cda1ccc86
xfs: add missing bmap cancel calls in error paths

Source kernel commit d4a97a04227d5ba91b91888a016e2300861cfbc7

If a failure occurs after the bmap free list is populated and before
xfs_bmap_finish() completes successfully (which returns a partial
list on failure), the bmap free list must be cancelled. Otherwise,
the extent items on the list are never freed and a memory leak
occurs.

Several random error paths throughout the code suffer this problem.
Fix these up such that xfs_bmap_cancel() is always called on error.

Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Dave Chinner <david@fromorbit.com>
libxfs/xfs_bmap.c