Merge tag 'for-4.20-rc4-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave...
[linux] / fs / ioctl.c
index 72537b6..d64f622 100644 (file)
@@ -232,7 +232,7 @@ static long ioctl_file_clone(struct file *dst_file, unsigned long srcfd,
        if (src_file.file->f_path.mnt != dst_file->f_path.mnt)
                goto fdput;
        cloned = vfs_clone_file_range(src_file.file, off, dst_file, destoff,
-                                     olen);
+                                     olen, 0);
        if (cloned < 0)
                ret = cloned;
        else if (olen && cloned != olen)
@@ -677,6 +677,9 @@ int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
                return ioctl_fiemap(filp, arg);
 
        case FIGETBSZ:
+               /* anon_bdev filesystems may not have a block size */
+               if (!inode->i_sb->s_blocksize)
+                       return -EINVAL;
                return put_user(inode->i_sb->s_blocksize, argp);
 
        case FICLONE: