-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Don't use flock on NFS mounts #2623
Conversation
Completely skip file locking when we detect an NFS mount via `statfs`. Closes rust-lang#2615
r? @brson |
r? @huonw (rust_highfive has picked a reviewer for you, use r? to override) |
let mut buf: libc::statfs = mem::zeroed(); | ||
let r = libc::statfs(path.as_ptr(), &mut buf); | ||
|
||
r == 0 && buf.f_type == libc::NFS_SUPER_MAGIC |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After googling this I'm even more curious. Just magic stuff.
@bors r+ |
📌 Commit b0ecb90 has been approved by |
Don't use flock on NFS mounts Completely skip file locking when we detect an NFS mount via `statfs`. Closes #2615
Do you know what happens when using NFS on other Oses? |
I have no idea :( |
☀️ Test successful - cargo-cross-linux, cargo-linux-32, cargo-linux-64, cargo-mac-32, cargo-mac-64, cargo-win-gnu-32, cargo-win-gnu-64, cargo-win-msvc-32, cargo-win-msvc-64 |
Here is an examples of lock file error on an nfs file system on OS X. |
@Kerosene2000 thanks for the report! I'll send a PR soon |
(PR is #2720) |
Completely skip file locking when we detect an NFS mount via
statfs
.Closes #2615