vfs: wire up compat ioctl for CLONE/CLONE_RANGE
authorDarrick J. Wong <darrick.wong@oracle.com>
Sat, 19 Dec 2015 08:55:52 +0000 (00:55 -0800)
committerAl Viro <viro@zeniv.linux.org.uk>
Fri, 1 Jan 2016 07:36:02 +0000 (02:36 -0500)
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/compat_ioctl.c
fs/read_write.c

index dcf26537c935f25ed10a534a13e31492802c5369..70d4b104c08d4adc58bf8e40d5f522cf693a942b 100644 (file)
@@ -1580,6 +1580,10 @@ COMPAT_SYSCALL_DEFINE3(ioctl, unsigned int, fd, unsigned int, cmd,
                goto out_fput;
 #endif
 
+       case FICLONE:
+       case FICLONERANGE:
+               goto do_ioctl;
+
        case FIBMAP:
        case FIGETBSZ:
        case FIONREAD:
index c75d02cb13ec72ebcae358360811069d62406edb..60ee269412313b90e1b5d399ee3bcaea0df701b6 100644 (file)
@@ -1489,7 +1489,7 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
        if (S_ISDIR(inode_in->i_mode) || S_ISDIR(inode_out->i_mode))
                return -EISDIR;
        if (!S_ISREG(inode_in->i_mode) || !S_ISREG(inode_out->i_mode))
-               return -EOPNOTSUPP;
+               return -EINVAL;
 
        if (!(file_in->f_mode & FMODE_READ) ||
            !(file_out->f_mode & FMODE_WRITE) ||