Commit 0fcbf996 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Al Viro

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
parent b6853f78
...@@ -1533,10 +1533,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in, ...@@ -1533,10 +1533,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in,
if (!(file_in->f_mode & FMODE_READ) || if (!(file_in->f_mode & FMODE_READ) ||
!(file_out->f_mode & FMODE_WRITE) || !(file_out->f_mode & FMODE_WRITE) ||
(file_out->f_flags & O_APPEND) || (file_out->f_flags & O_APPEND))
!file_in->f_op->clone_file_range)
return -EBADF; return -EBADF;
if (!file_in->f_op->clone_file_range)
return -EOPNOTSUPP;
ret = clone_verify_area(file_in, pos_in, len, false); ret = clone_verify_area(file_in, pos_in, len, false);
if (ret) if (ret)
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment