Per the comments at the head of fs_nacl.go, unexported methods expect
the fs mutex to have been taken by the caller.
This change brings Link and Rename into line with the other exported
functions wrt fs locking.
Fixes #22690
Change-Id: I46d08f7d227f23ff49bb0099d218214364a45e1a
Reviewed-on: https://go-review.googlesource.com/79295
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
func Link(path, link string) error {
fsinit()
+ fs.mu.Lock()
+ defer fs.mu.Unlock()
ip, _, err := fs.namei(path, false)
if err != nil {
return err
func Rename(from, to string) error {
fsinit()
+ fs.mu.Lock()
+ defer fs.mu.Unlock()
fdp, felem, err := fs.namei(from, true)
if err != nil {
return err