Btrfs: setup a nofs context for memory allocation at __btrfs_set_acl
authorFilipe Manana <fdmanana@suse.com>
Thu, 13 Dec 2018 21:16:56 +0000 (21:16 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 23 Mar 2019 19:10:00 +0000 (20:10 +0100)
commit6e24f5a1ebb199c8dcd84f7b91fe8ba120ecfe32
tree385576b84aa595ae6b837eb8bc6f21222c250bdf
parent61f9209676e854973a8b7aaed93de16f727c4a32
Btrfs: setup a nofs context for memory allocation at __btrfs_set_acl

commit a0873490660246db587849a9e172f2b7b21fa88a upstream.

We are holding a transaction handle when setting an acl, therefore we can
not allocate the xattr value buffer using GFP_KERNEL, as we could deadlock
if reclaim is triggered by the allocation, therefore setup a nofs context.

Fixes: 39a27ec1004e8 ("btrfs: use GFP_KERNEL for xattr and acl allocations")
CC: stable@vger.kernel.org # 4.9+
Reviewed-by: Nikolay Borisov <nborisov@suse.com>
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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/btrfs/acl.c