diff -Naur linux-4.4.6.ORIG/fs/btrfs/ctree.c linux-4.4.6/fs/btrfs/ctree.c --- linux-4.4.6.ORIG/fs/btrfs/ctree.c 2016-01-10 13:01:32.000000000 -1000 +++ linux-4.4.6/fs/btrfs/ctree.c 2016-03-30 06:19:16.397973820 -1000 @@ -20,6 +20,7 @@ #include #include #include "ctree.h" +#include #include "disk-io.h" #include "transaction.h" #include "print-tree.h" @@ -5362,10 +5363,13 @@ goto out; } - tmp_buf = kmalloc(left_root->nodesize, GFP_NOFS); + tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL | __GFP_NOWARN); if (!tmp_buf) { - ret = -ENOMEM; - goto out; + tmp_buf = vmalloc(left_root->nodesize); + if (!tmp_buf) { + ret = -ENOMEM; + goto out; + } } left_path->search_commit_root = 1; @@ -5566,7 +5570,7 @@ out: btrfs_free_path(left_path); btrfs_free_path(right_path); - kfree(tmp_buf); + kvfree(tmp_buf); return ret; }