btrfs: send: use vmalloc only as fallback for read_buf
Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
@@ -6037,11 +6037,14 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sctx->read_buf = kmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL | __GFP_NOWARN);
|
||||||
|
if (!sctx->read_buf) {
|
||||||
sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
|
sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
|
||||||
if (!sctx->read_buf) {
|
if (!sctx->read_buf) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sctx->pending_dir_moves = RB_ROOT;
|
sctx->pending_dir_moves = RB_ROOT;
|
||||||
sctx->waiting_dir_moves = RB_ROOT;
|
sctx->waiting_dir_moves = RB_ROOT;
|
||||||
@@ -6224,7 +6227,7 @@ out:
|
|||||||
|
|
||||||
vfree(sctx->clone_roots);
|
vfree(sctx->clone_roots);
|
||||||
kvfree(sctx->send_buf);
|
kvfree(sctx->send_buf);
|
||||||
vfree(sctx->read_buf);
|
kvfree(sctx->read_buf);
|
||||||
|
|
||||||
name_cache_free(sctx);
|
name_cache_free(sctx);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user