-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
io: copy fails with EOPNOTSUPP on NFSv4.1 #41064
Comments
At the rate we have to work around broken kernels, I wonder if |
cc @thoeni |
Happy to create a CL for this one, I think I'm now familiar with the issue.
As a clarification on this one, I understand if it's not supported but the underlying kernel we should store this in the atomic value for future reuse instead of checking all the times, but I'm not sure on the intermittent nature of the issue...
|
Also, I just noticed that this has been already addressed by: #40731 I got confused between the two |
Yes, this does seem to duplicate that issue. |
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yep.
What operating system and processor architecture are you using?
linux/amd64
This seems to be an issue specific to RHEL/CentOS 7.8 (and possibly other RHEL/CentOS 7 versions), and specifically with copying between files on the same NFSv4 filesystem.
What did you do?
In a directory that is on an NFSv4.1 mount on a host running CentOS 7.8
What did you expect to see?
No error.
What did you see instead?
Error
EOPNOTSUPP
. In some cases it can be intermittent, depending on server behavior.The
copy_file_range
syscall is supposed to fail with ENOSYS, EXDEV, or EINVAL if there isn't appropriate support from the kernel/filesystem, in which caseinternal/poll.CopyFileRange
will return a value indicating that the copy was not handled, and copying will proceed with a fallback implementation from there.Unfortunately, for some versions of NFSv4, including the implementation present on CentOS/RHEL 7, if the server does not support range copies, NFSv4 will instead return EOPNOTSUPP, and due to a workaround in the kernel used by CentOS/RHEL 7.8.
There is a nearly identical issue open for the Rust standard library, which unfortunately some of our customers have already encountered. We haven't started shipping anything with Go 1.15 yet.
The conclusion of the issue thread in Rust appears to be that the best thing to do here is treat EOPNOTSUPP as the same as ENOSYS. I personally agree with that conclusion. Pedantically speaking the bug is definitely in those kernels, not in Go, but unfortunately CentOS 7 is far too popular to ignore.
The text was updated successfully, but these errors were encountered: