Btrfs: use nofs context when initializing security xattrs to avoid deadlock
authorFilipe Manana <fdmanana@suse.com>
Mon, 10 Dec 2018 17:53:35 +0000 (17:53 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 16 Jan 2019 21:04:37 +0000 (22:04 +0100)
commit7a1b9b76bac76498657b9322164957c2a50c573b
tree993dea84f1f74ffb47827491723ab03266ab0c50
parent79aa5c0daa5c7a2c4de945f4964702f3fcb6f8a3
Btrfs: use nofs context when initializing security xattrs to avoid deadlock

commit 827aa18e7b903c5ff3b3cd8fec328a99b1dbd411 upstream.

When initializing the security xattrs, we are holding a transaction handle
therefore we need to use a GFP_NOFS context in order to avoid a deadlock
with reclaim in case it's triggered.

Fixes: 39a27ec1004e8 ("btrfs: use GFP_KERNEL for xattr and acl allocations")
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/xattr.c