]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - fs/btrfs/send.c
Merge branch 'for-linus-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/mason...
[karo-tx-linux.git] / fs / btrfs / send.c
index 5b40d617bb0378d61fcf7e676e997831b0ba3e3b..fc496a6f842a87d3544e80b3b9e063d57417f788 100644 (file)
@@ -6379,22 +6379,16 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
        sctx->clone_roots_cnt = arg->clone_sources_count;
 
        sctx->send_max_size = BTRFS_SEND_BUF_SIZE;
-       sctx->send_buf = kmalloc(sctx->send_max_size, GFP_KERNEL | __GFP_NOWARN);
+       sctx->send_buf = kvmalloc(sctx->send_max_size, GFP_KERNEL);
        if (!sctx->send_buf) {
-               sctx->send_buf = vmalloc(sctx->send_max_size);
-               if (!sctx->send_buf) {
-                       ret = -ENOMEM;
-                       goto out;
-               }
+               ret = -ENOMEM;
+               goto out;
        }
 
-       sctx->read_buf = kmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL | __GFP_NOWARN);
+       sctx->read_buf = kvmalloc(BTRFS_SEND_READ_SIZE, GFP_KERNEL);
        if (!sctx->read_buf) {
-               sctx->read_buf = vmalloc(BTRFS_SEND_READ_SIZE);
-               if (!sctx->read_buf) {
-                       ret = -ENOMEM;
-                       goto out;
-               }
+               ret = -ENOMEM;
+               goto out;
        }
 
        sctx->pending_dir_moves = RB_ROOT;
@@ -6415,13 +6409,10 @@ long btrfs_ioctl_send(struct file *mnt_file, void __user *arg_)
        alloc_size = arg->clone_sources_count * sizeof(*arg->clone_sources);
 
        if (arg->clone_sources_count) {
-               clone_sources_tmp = kmalloc(alloc_size, GFP_KERNEL | __GFP_NOWARN);
+               clone_sources_tmp = kvmalloc(alloc_size, GFP_KERNEL);
                if (!clone_sources_tmp) {
-                       clone_sources_tmp = vmalloc(alloc_size);
-                       if (!clone_sources_tmp) {
-                               ret = -ENOMEM;
-                               goto out;
-                       }
+                       ret = -ENOMEM;
+                       goto out;
                }
 
                ret = copy_from_user(clone_sources_tmp, arg->clone_sources,