Skip to content
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

Don't use flock on NFS mounts #2623

Merged
merged 1 commit into from
Apr 29, 2016
Merged

Conversation

alexcrichton
Copy link
Member

Completely skip file locking when we detect an NFS mount via statfs.

Closes #2615

Completely skip file locking when we detect an NFS mount via `statfs`.

Closes rust-lang#2615
@alexcrichton
Copy link
Member Author

r? @brson

@rust-highfive
Copy link

r? @huonw

(rust_highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive assigned brson and unassigned huonw Apr 26, 2016
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
Copy link
Contributor

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.

@brson
Copy link
Contributor

brson commented Apr 29, 2016

@bors r+

@bors
Copy link
Contributor

bors commented Apr 29, 2016

📌 Commit b0ecb90 has been approved by brson

@bors
Copy link
Contributor

bors commented Apr 29, 2016

⌛ Testing commit b0ecb90 with merge 27161ec...

bors added a commit that referenced this pull request Apr 29, 2016
Don't use flock on NFS mounts

Completely skip file locking when we detect an NFS mount via `statfs`.

Closes #2615
@brson
Copy link
Contributor

brson commented Apr 29, 2016

Do you know what happens when using NFS on other Oses?

@alexcrichton
Copy link
Member Author

I have no idea :(

@bors
Copy link
Contributor

bors commented Apr 29, 2016

@bors bors merged commit b0ecb90 into rust-lang:master Apr 29, 2016
@Kerollmops
Copy link

Here is an examples of lock file error on an nfs file system on OS X.

@alexcrichton alexcrichton deleted the nfs-lol-no branch May 19, 2016 19:08
@alexcrichton
Copy link
Member Author

@Kerosene2000 thanks for the report! I'll send a PR soon

@alexcrichton
Copy link
Member Author

(PR is #2720)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants