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

syscall: fs_nacl.go: Link and Rename missing fs mutex lock/unlock #22690

Closed
tenortim opened this issue Nov 13, 2017 · 2 comments
Closed

syscall: fs_nacl.go: Link and Rename missing fs mutex lock/unlock #22690

tenortim opened this issue Nov 13, 2017 · 2 comments

Comments

@tenortim
Copy link
Contributor

@tenortim tenortim commented Nov 13, 2017

Please answer these questions before submitting your issue. Thanks!

What version of Go are you using (go version)?

go version go1.9.2 darwin/amd64

Does this issue reproduce with the latest release?

Issue uncovered by inspection.

What operating system and processor architecture are you using (go env)?

Go playground using GOOS=nacl

What did you do?

Per comments at the head of fs_nacl.go:

// Since there is no I/O (everything is in memory),
// the global lock mu protects the whole file system state,
// and that's okay.

and

// Except where indicated otherwise, unexported methods on fsys
// expect fs.mu to have been locked by the caller.

but Link and Rename call these methods without locking fs.

What did you expect to see?

fs calls should be serialized

What did you see instead?

These two are not.
Fix is trivial. I'm happy the needed changes

@bradfitz bradfitz added this to the Unplanned milestone Nov 13, 2017
@bradfitz bradfitz added the NeedsFix label Nov 13, 2017
@bradfitz
Copy link
Contributor

@bradfitz bradfitz commented Nov 13, 2017

Fine for Go 1.10, or whenever. Thanks.

@gopherbot
Copy link

@gopherbot gopherbot commented Nov 22, 2017

Change https://golang.org/cl/79295 mentions this issue: syscall: add missing fs locking in Link, Rename

@gopherbot gopherbot closed this in a2a1c17 Nov 22, 2017
@golang golang locked and limited conversation to collaborators Nov 22, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.