]> git.proxmox.com Git - mirror_ubuntu-hirsute-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)
committerAndrea Righi <andrea.righi@canonical.com>
Mon, 15 Mar 2021 15:22:03 +0000 (16:22 +0100)
commit9e6e8e7e692f63373c17e7c866759b6b1e9b2fd6
tree7d6de942c44919d088afb0f74f45ea82485a43cd
parentf8a2741548edbc5e6270677f3a61972ab2fc67fe
btrfs: unlock extents in btrfs_zero_range in case of quota reservation errors

commit 4f6a49de64fd1b1dba5229c02047376da7cf24fd upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
fs/btrfs/file.c