aboutsummaryrefslogtreecommitdiffstats
path: root/fs/btrfs/ctree.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/btrfs/ctree.c')
-rw-r--r--fs/btrfs/ctree.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/btrfs/ctree.c b/fs/btrfs/ctree.c
index 77592931ab4f..ec7928a27aaa 100644
--- a/fs/btrfs/ctree.c
+++ b/fs/btrfs/ctree.c
@@ -19,6 +19,7 @@
19#include <linux/sched.h> 19#include <linux/sched.h>
20#include <linux/slab.h> 20#include <linux/slab.h>
21#include <linux/rbtree.h> 21#include <linux/rbtree.h>
22#include <linux/vmalloc.h>
22#include "ctree.h" 23#include "ctree.h"
23#include "disk-io.h" 24#include "disk-io.h"
24#include "transaction.h" 25#include "transaction.h"
@@ -5361,10 +5362,13 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
5361 goto out; 5362 goto out;
5362 } 5363 }
5363 5364
5364 tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL); 5365 tmp_buf = kmalloc(left_root->nodesize, GFP_KERNEL | __GFP_NOWARN);
5365 if (!tmp_buf) { 5366 if (!tmp_buf) {
5366 ret = -ENOMEM; 5367 tmp_buf = vmalloc(left_root->nodesize);
5367 goto out; 5368 if (!tmp_buf) {
5369 ret = -ENOMEM;
5370 goto out;
5371 }
5368 } 5372 }
5369 5373
5370 left_path->search_commit_root = 1; 5374 left_path->search_commit_root = 1;
@@ -5565,7 +5569,7 @@ int btrfs_compare_trees(struct btrfs_root *left_root,
5565out: 5569out:
5566 btrfs_free_path(left_path); 5570 btrfs_free_path(left_path);
5567 btrfs_free_path(right_path); 5571 btrfs_free_path(right_path);
5568 kfree(tmp_buf); 5572 kvfree(tmp_buf);
5569 return ret; 5573 return ret;
5570} 5574}
5571 5575