]> git.baikalelectronics.ru Git - kernel.git/commit
Btrfs: add missing extents release on file extent cluster relocation error
authorFilipe Manana <fdmanana@suse.com>
Wed, 9 Oct 2019 16:43:45 +0000 (17:43 +0100)
committerDavid Sterba <dsterba@suse.com>
Fri, 11 Oct 2019 17:49:11 +0000 (19:49 +0200)
commit4299d1d3176929273c26a1c06cb775071fbd58ca
tree584d4dac8097603a5c850955546151b5618216d6
parentbad47a78f32061b925752763ce4334901d2e29db
Btrfs: add missing extents release on file extent cluster relocation error

If we error out when finding a page at relocate_file_extent_cluster(), we
need to release the outstanding extents counter on the relocation inode,
set by the previous call to btrfs_delalloc_reserve_metadata(), otherwise
the inode's block reserve size can never decrease to zero and metadata
space is leaked. Therefore add a call to btrfs_delalloc_release_extents()
in case we can't find the target page.

Fixes: 624926f17e6d ("Btrfs: rework outstanding_extents")
CC: stable@vger.kernel.org # 4.19+
Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/relocation.c