googlephotos: fix "concurrent map write" error - fixes #4003

This adds a bit of missed locking around the uploaded info to fix the
concurrent map write.

All the other accesses have locking - this one must have got missed.
This commit is contained in:
Nick Craig-Wood 2020-02-25 17:36:38 +00:00
parent 452fdbf1c1
commit 4d8d1e287b

View File

@ -1003,7 +1003,9 @@ func (o *Object) Update(ctx context.Context, in io.Reader, src fs.ObjectInfo, op
// Add upload to internal storage
if pattern.isUpload {
o.fs.uploadedMu.Lock()
o.fs.uploaded.AddEntry(o)
o.fs.uploadedMu.Unlock()
}
return nil
}