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
15331533
15341534 if (!(file_in->f_mode & FMODE_READ) ||
15351535 !(file_out->f_mode & FMODE_WRITE) ||
1536− (file_out->f_flags & O_APPEND) ||
1537− !file_in->f_op->clone_file_range)
1536+ (file_out->f_flags & O_APPEND))
15381537 return -EBADF;
15391538
1539+ if (!file_in->f_op->clone_file_range)
1540+ return -EOPNOTSUPP;
1541+
15401542 ret = clone_verify_area(file_in, pos_in, len, false);
15411543 if (ret)
15421544 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