diff options
author | Christoph Hellwig <hch@lst.de> | 2016-02-26 12:53:12 -0500 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2016-02-27 19:15:51 -0500 |
commit | 0fcbf996d848d03573113d83f4e3fb3bcfa5ab5e (patch) | |
tree | 4c338e97a056ce9eb6b6e55c126eca47640ba624 /fs/read_write.c | |
parent | b6853f78e763d42c7a158d8de3549c9827c604ab (diff) |
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 <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/read_write.c')
-rw-r--r-- | fs/read_write.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/fs/read_write.c b/fs/read_write.c index 0c8782aa3d71..dadf24e5c95b 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, | |||
1533 | 1533 | ||
1534 | if (!(file_in->f_mode & FMODE_READ) || | 1534 | if (!(file_in->f_mode & FMODE_READ) || |
1535 | !(file_out->f_mode & FMODE_WRITE) || | 1535 | !(file_out->f_mode & FMODE_WRITE) || |
1536 | (file_out->f_flags & O_APPEND) || | 1536 | (file_out->f_flags & O_APPEND)) |
1537 | !file_in->f_op->clone_file_range) | ||
1538 | return -EBADF; | 1537 | return -EBADF; |
1539 | 1538 | ||
1539 | if (!file_in->f_op->clone_file_range) | ||
1540 | return -EOPNOTSUPP; | ||
1541 | |||
1540 | ret = clone_verify_area(file_in, pos_in, len, false); | 1542 | ret = clone_verify_area(file_in, pos_in, len, false); |
1541 | if (ret) | 1543 | if (ret) |
1542 | return ret; | 1544 | return ret; |