aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_file_read.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/mount/weedfs_file_read.go')
-rw-r--r--weed/mount/weedfs_file_read.go7
1 files changed, 6 insertions, 1 deletions
diff --git a/weed/mount/weedfs_file_read.go b/weed/mount/weedfs_file_read.go
index 2af42b333..22b87fdad 100644
--- a/weed/mount/weedfs_file_read.go
+++ b/weed/mount/weedfs_file_read.go
@@ -1,9 +1,11 @@
package mount
import (
+ "io"
+
"github.com/hanwen/go-fuse/v2/fuse"
+
"github.com/seaweedfs/seaweedfs/weed/glog"
- "io"
)
/**
@@ -37,6 +39,9 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse
return nil, fuse.ENOENT
}
+ fh.entryLock.Lock()
+ defer fh.entryLock.Unlock()
+
offset := int64(in.Offset)
fh.lockForRead(offset, len(buff))
defer fh.unlockForRead(offset, len(buff))