aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/filehandle_map.go
diff options
context:
space:
mode:
authorPatrick Schmidt <patrick.schmidt@innogames.com>2022-08-27 01:41:37 +0200
committerGitHub <noreply@github.com>2022-08-26 16:41:37 -0700
commit5df105b1f94b8776d18159ae213da39299e2ea37 (patch)
tree947bd9517ff31f6927dcaed3019c117179073a48 /weed/mount/filehandle_map.go
parentf5156cf3a8d08622574865532ef5139537384b40 (diff)
downloadseaweedfs-5df105b1f94b8776d18159ae213da39299e2ea37.tar.xz
seaweedfs-5df105b1f94b8776d18159ae213da39299e2ea37.zip
Fix a few data races when reading files in mount (#3527)
Diffstat (limited to 'weed/mount/filehandle_map.go')
-rw-r--r--weed/mount/filehandle_map.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/mount/filehandle_map.go b/weed/mount/filehandle_map.go
index a5e1016ca..4cf674166 100644
--- a/weed/mount/filehandle_map.go
+++ b/weed/mount/filehandle_map.go
@@ -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
}