]> git.hungrycats.org Git - linux/commit
btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors
authorNikolay Borisov <nborisov@suse.com>
Tue, 23 Feb 2021 13:20:42 +0000 (15:20 +0200)
committerDavid Sterba <dsterba@suse.com>
Tue, 23 Feb 2021 13:59:45 +0000 (14:59 +0100)
commita646ddc2bba2a0cce39f37d8987865db0442b85a
tree98eb4165530876cbdfcfb6429bffb37ecc33172b
parent20bbf8c91dc017b61a8c2b8330a29f984cf69880
btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors

If btrfs_qgroup_reserve_data returns an error (i.e quota limit reached)
the handling logic directly goes to the 'out' label without first
unlocking the extent range between lockstart, lockend. This results in
deadlocks as other processes try to lock the same extent.

Fixes: a7f8b1c2ac21 ("btrfs: file: reserve qgroup space after the hole punch range is locked")
CC: stable@vger.kernel.org # 5.10+
Reviewed-by: Qu Wenruo <wqu@suse.com>
Signed-off-by: Nikolay Borisov <nborisov@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
fs/btrfs/file.c