mirror of
https://github.com/rclone/rclone.git
synced 2024-11-25 08:38:54 +08:00
vfs: fix data race discovered by the race detector
This fixes a place where we read from item.o without the item.mu held.
This commit is contained in:
parent
25d5ed763c
commit
687a3b1832
|
@ -605,8 +605,9 @@ func (item *Item) _store(ctx context.Context, storeFn StoreFn) (err error) {
|
|||
fs.Debugf(item.name, "vfs cache: writeback object to VFS layer")
|
||||
// Write the object back to the VFS layer as last
|
||||
// thing we do with mutex unlocked
|
||||
o := item.o
|
||||
item.mu.Unlock()
|
||||
storeFn(item.o)
|
||||
storeFn(o)
|
||||
item.mu.Lock()
|
||||
}
|
||||
return nil
|
||||
|
|
Loading…
Reference in New Issue
Block a user