From: Christoph Hellwig Date: Fri, 26 Feb 2016 17:53:12 +0000 (+0100) Subject: fs: return -EOPNOTSUPP if clone is not supported X-Git-Tag: v4.9.8~2470^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0fcbf996d848d03573113d83f4e3fb3bcfa5ab5e;p=platform%2Fkernel%2Flinux-rpi3.git fs: return -EOPNOTSUPP if clone is not supported -EBADF is a rather confusing error if an operations is not supported, and nfsd gets rather upset about it. Signed-off-by: Christoph Hellwig Signed-off-by: Al Viro --- diff --git a/fs/read_write.c b/fs/read_write.c index 0c8782a..dadf24e 100644 --- a/fs/read_write.c +++ b/fs/read_write.c @@ -1533,10 +1533,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in, if (!(file_in->f_mode & FMODE_READ) || !(file_out->f_mode & FMODE_WRITE) || - (file_out->f_flags & O_APPEND) || - !file_in->f_op->clone_file_range) + (file_out->f_flags & O_APPEND)) return -EBADF; + if (!file_in->f_op->clone_file_range) + return -EOPNOTSUPP; + ret = clone_verify_area(file_in, pos_in, len, false); if (ret) return ret;