Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 15351955 authored by David Sterba's avatar David Sterba
Browse files

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



Signed-off-by: default avatarDavid Sterba <dsterba@suse.com>
parent 2f91306a
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -3468,13 +3468,16 @@ static int btrfs_clone(struct inode *src, struct inode *inode,
	u64 last_dest_end = destoff;

	ret = -ENOMEM;
	buf = kmalloc(root->nodesize, GFP_KERNEL | __GFP_NOWARN);
	if (!buf) {
		buf = vmalloc(root->nodesize);
		if (!buf)
			return ret;
	}

	path = btrfs_alloc_path();
	if (!path) {
		vfree(buf);
		kvfree(buf);
		return ret;
	}

@@ -3775,7 +3778,7 @@ static int btrfs_clone(struct inode *src, struct inode *inode,

out:
	btrfs_free_path(path);
	vfree(buf);
	kvfree(buf);
	return ret;
}