diff options
author | David Sterba <dsterba@suse.com> | 2016-04-11 18:40:08 +0200 |
---|---|---|
committer | David Sterba <dsterba@suse.com> | 2016-05-06 15:22:49 +0200 |
commit | eb5b75fe2e61a9ba907785b70318736112b0cf93 (patch) | |
tree | f1f38a21a3aac1a4bb27263afe4535234363583f /fs/btrfs/send.c | |
parent | 6ff48ce06b07255a6459cd8b816a110971a81f00 (diff) | |
download | op-kernel-dev-eb5b75fe2e61a9ba907785b70318736112b0cf93.zip op-kernel-dev-eb5b75fe2e61a9ba907785b70318736112b0cf93.tar.gz |
btrfs: send: use vmalloc only as fallback for read_buf
Signed-off-by: David Sterba <dsterba@suse.com>
Diffstat (limited to 'fs/btrfs/send.c')
-rw-r--r-- | fs/btrfs/send.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/fs/btrfs/send.c b/fs/btrfs/send.c index b6e2c6e..4e950eb 100644 --- a/fs/btrfs/send.c +++ b/fs/btrfs/send.c @@ -6037,10 +6037,13 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) } } - sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE); + sctx->read_buf = kmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL | __GFP_NOWARN); if (!sctx->read_buf) { - ret = -ENOMEM; - goto out; + sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE); + if (!sctx->read_buf) { + ret = -ENOMEM; + goto out; + } } sctx->pending_dir_moves = RB_ROOT; @@ -6224,7 +6227,7 @@ out: vfree(sctx->clone_roots); kvfree(sctx->send_buf); - vfree(sctx->read_buf); + kvfree(sctx->read_buf); name_cache_free(sctx); |