]> git.baikalelectronics.ru Git - kernel.git/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, 2 Mar 2021 15:55:44 +0000 (16:55 +0100)
commit30e1badc3e55384c6923acd910f4947d01cf044a
tree7c8b4302b77b5d964d8ed9d740c6456aaca04bd3
parent9aedef7307bf700056bfad334c0c9ee63cd81f79
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: eb5819e83dfd ("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