Commit 15351955 authored by David Sterba's avatar David Sterba

btrfs: clone: use vmalloc only as fallback for nodesize bufer

Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2f91306a
...@@ -3468,13 +3468,16 @@ static int btrfs_clone(struct inode *src, struct inode *inode, ...@@ -3468,13 +3468,16 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
u64 last_dest_end = destoff; u64 last_dest_end = destoff;
ret = -ENOMEM; ret = -ENOMEM;
buf = vmalloc(root->nodesize); buf = kmalloc(root->nodesize, GFP_KERNEL | __GFP_NOWARN);
if (!buf) if (!buf) {
return ret; buf = vmalloc(root->nodesize);
if (!buf)
return ret;
}
path = btrfs_alloc_path(); path = btrfs_alloc_path();
if (!path) { if (!path) {
vfree(buf); kvfree(buf);
return ret; return ret;
} }
...@@ -3775,7 +3778,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode, ...@@ -3775,7 +3778,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
out: out:
btrfs_free_path(path); btrfs_free_path(path);
vfree(buf); kvfree(buf);
return ret; return ret;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment