On Thu, Dec 13, 2018 at 09:16:45PM +0000, fdmanana@xxxxxxxxxx wrote:
> From: Filipe Manana <fdmanana@xxxxxxxx>
>
> We are holding a transaction handle when creating a tree, therefore we can
> not allocate the root using GFP_KERNEL, as we could deadlock if reclaim is
> triggered by the allocation, therefore setup a nofs context.
>
> Fixes: 74e4d82757f74 ("btrfs: let callers of btrfs_alloc_root pass gfp flags")
> Signed-off-by: Filipe Manana <fdmanana@xxxxxxxx>
Added to misc-next, thanks.
Regarding this class of bugs, I'm not sure if I mentioned it or not, the
long-term fix is to set NOFS in transaction start and restore at
end/commit. I have a wip patch but not near completion so until then
the individual callsites need to be handled.