History

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.

Christoph Hellwig committed 10 years ago

Commit 0fcbf991 parent b6853f71 file · +4 −2Browse files

Unified · Split

fs/read_write.c+4−2
@@ -1533,10 +1533,12 @@ int vfs_clone_file_range(struct file *file_in, loff_t pos_in, · 1532 unmodified lines
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;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t