mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 09:41:44 +08:00
vfs: make File lock and Dir lock not overlap to avoid deadlock
This was caused by this commit which wasn't part of 1.51.0
3c91abce74
vfs: fix race condition caused by unlocked reading of Dir.path
This commit is contained in:
parent
2a62471e4c
commit
3911a49256
|
@ -97,8 +97,9 @@ func (f *File) _path() string {
|
|||
// Path returns the full path of the file
|
||||
func (f *File) Path() string {
|
||||
f.mu.RLock()
|
||||
defer f.mu.RUnlock()
|
||||
return f._path()
|
||||
d, leaf := f.d, f.leaf
|
||||
f.mu.RUnlock()
|
||||
return path.Join(d.Path(), leaf)
|
||||
}
|
||||
|
||||
// osPath returns the full path of the file in the cache in OS format
|
||||
|
|
Loading…
Reference in New Issue
Block a user