提交 6ff48ce0 编写于 作者: D David Sterba

btrfs: send: use vmalloc only as fallback for send_buf

Signed-off-by: NDavid Sterba <dsterba@suse.com>
上级 779bf3fe
...@@ -6028,11 +6028,14 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) ...@@ -6028,11 +6028,14 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
sctx->clone_roots_cnt = arg->clone_sources_count; sctx->clone_roots_cnt = arg->clone_sources_count;
sctx->send_max_size = BTRFS_SEND_BUF_SIZE; sctx->send_max_size = BTRFS_SEND_BUF_SIZE;
sctx->send_buf = kmalloc(sctx->send_max_size, GFP_KERNEL | __GFP_NOWARN);
if (!sctx->send_buf) {
sctx->send_buf = vmalloc(sctx->send_max_size); sctx->send_buf = vmalloc(sctx->send_max_size);
if (!sctx->send_buf) { if (!sctx->send_buf) {
ret = -ENOMEM; ret = -ENOMEM;
goto out; goto out;
} }
}
sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE); sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
if (!sctx->read_buf) { if (!sctx->read_buf) {
...@@ -6220,7 +6223,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_) ...@@ -6220,7 +6223,7 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
fput(sctx->send_filp); fput(sctx->send_filp);
vfree(sctx->clone_roots); vfree(sctx->clone_roots);
vfree(sctx->send_buf); kvfree(sctx->send_buf);
vfree(sctx->read_buf); vfree(sctx->read_buf);
name_cache_free(sctx); name_cache_free(sctx);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册