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)
committerDavid Sterba <dsterba@suse.com>
Mon, 23 Nov 2020 20:16:40 +0000 (21:16 +0100)
commit7aa6d359845a9dbf7ad90b0b1b6347ef4764621f
treee34bbb885dfb58867e84da5e6ba1171660b250b7
parent3d05cad3c357a2b749912914356072b38435edfa
btrfs: do nofs allocations when adding and removing qgroup relations

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>
fs/btrfs/qgroup.c