mirror of
https://github.com/rclone/rclone.git
synced 2025-01-24 15:21:08 +01: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")
|
fs.Debugf(item.name, "vfs cache: writeback object to VFS layer")
|
||||||
// Write the object back to the VFS layer as last
|
// Write the object back to the VFS layer as last
|
||||||
// thing we do with mutex unlocked
|
// thing we do with mutex unlocked
|
||||||
|
o := item.o
|
||||||
item.mu.Unlock()
|
item.mu.Unlock()
|
||||||
storeFn(item.o)
|
storeFn(o)
|
||||||
item.mu.Lock()
|
item.mu.Lock()
|
||||||
}
|
}
|
||||||
return nil
|
return nil
|
||||||
|
Loading…
Reference in New Issue
Block a user