btrfs: do nofs allocations when adding and removing qgroup relations
authorFilipe Manana <fdmanana@suse.com>
Mon, 23 Nov 2020 18:30:54 +0000 (18:30 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Dec 2020 09:58:32 +0000 (10:58 +0100)
commita70b249621fa0586620ad419cd4d8d15ccd1d126
tree2d00ff07917571af6a554e574c0657e53227b3a1
parent6d9b478ef5a8a2be0e2682222471c7db7b43e096
btrfs: do nofs allocations when adding and removing qgroup relations

[ Upstream commit 7aa6d359845a9dbf7ad90b0b1b6347ef4764621f ]

When adding or removing a qgroup relation we are doing a GFP_KERNEL
allocation which is not safe because we are holding a transaction
handle open and that can make us deadlock if the allocator needs to
recurse into the filesystem. So just surround those calls with a
nofs context.

Signed-off-by: Filipe Manana <fdmanana@suse.com>
Reviewed-by: David Sterba <dsterba@suse.com>
Signed-off-by: David Sterba <dsterba@suse.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/btrfs/qgroup.c