Fix a few data races when reading files in mount (#3527)

This commit is contained in:
Patrick Schmidt
2022-08-27 01:41:37 +02:00
committed by GitHub
parent f5156cf3a8
commit 5df105b1f9
6 changed files with 70 additions and 37 deletions

View File

@@ -1,8 +1,9 @@
package mount
import (
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
"sync"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
)
type FileHandleToInode struct {
@@ -49,7 +50,9 @@ func (i *FileHandleToInode) AcquireFileHandle(wfs *WFS, inode uint64, entry *fil
} else {
fh.counter++
}
fh.entry = entry
if fh.entry != entry {
fh.SetEntry(entry)
}
return fh
}