From: David Sterba Date: Wed, 31 May 2017 16:40:02 +0000 (+0200) Subject: btrfs: send: use kvmalloc in iterate_dir_item X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f11f74416ae6e63a6d6db9c5b22666a0aa57b881;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git btrfs: send: use kvmalloc in iterate_dir_item We use a growing buffer for xattrs larger than a page size, at some point vmalloc is unconditionally used for larger buffers. We can still try to avoid it using the kvmalloc helper. Reviewed-by: Anand Jain Signed-off-by: David Sterba --- diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index 924b1d941b53..7416b17c0eac 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -1083,7 +1083,7 @@ static int iterate_dir_item(struct btrfs_root *root, struct btrfs_path *path, buf = tmp; } if (!buf) { - buf = vmalloc(buf_len); + buf = kvmalloc(buf_len, GFP_KERNEL); if (!buf) { ret = -ENOMEM; goto out;