-
Notifications
You must be signed in to change notification settings - Fork 13.1k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
std::fs::copy fails on NFS volumes on CentOS 7 #75387
Comments
This bug doesn't occur every time, because I think Code Exampleuse std::fs::copy;
const NFS_IN: &'static str = "/some/nfs/mount/in";
const NFS_OUT: &'static str = "/some/nfs/mount/out";
const XFS_IN: &'static str = "/some/xfs/mount/in";
const XFS_OUT: &'static str = "/some/xfs/mount/out";
fn main() {
println!("{:?}", copy(NFS_IN, NFS_OUT)); // Err(Os { code: 95, kind: Other, message: "Operation not supported" })
println!("{:?}", copy(XFS_IN, XFS_OUT)); // Ok(1)
println!("{:?}", copy(NFS_IN, NFS_OUT)); // Ok(1)
} |
This might be a kernel bug or documentation error because EOPNOTSUPP is not listed in the So that's probably fixed in a newer kernel version, but who knows with redhat's frankenkernels. |
If a kernel update doesn't fix it you could also report this to the distro maintainers too, they might have missed something when backporting patches. I haven't looked at the centos kernel sources though, so that's just a guess. |
Cc @cuviper @joshtriplett, though not sure if you are the right people to ask about the possible kernel issue mentioned above. Regardless we will likely need to handle this ourselves as kernel or distro updates will likely be slow. |
Ok, should be easy enough. @rustbot claim |
It only remembers that if it encounters specific error codes ( Can you trace the syscalls of your test program via |
I know that RHEL 7.8 disabled
However, I think an |
Oh that's a mess, so it returns ENOSYS in most cases but in some cases |
Yes, treating EOPNOTSUPP as ENOSYS here seems like an appropriate workaround for the kernel bug. |
I've run strace on the test program I wrote earlier.
On an NFS filesystem:
|
For some systems (like the one I'm working with), updating is likely not going to happen, and this bug pretty much breaks rustup. I agree with treating Future testing for this and related bugs should be done carefully. A simple |
…triplett Workarounds for copy_file_range issues fixes rust-lang#75387 fixes rust-lang#75446
I tried this code:
I expected to see this happen: The file is successfully copied
Instead, this happened:
Meta
rustc --version --verbose
:Backtrace
Apologies for screenshots, I'm running in a VM I can't easily copy/paste out of.
See also rust-lang/rustup#2452, which has a likely explanation of the cause of this.
The text was updated successfully, but these errors were encountered: