diff options
| author | chrislu <chris.lu@gmail.com> | 2022-06-05 18:15:06 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-06-05 18:15:06 -0700 |
| commit | d65bb2c6df1a21ff2833717a16e549de971316b7 (patch) | |
| tree | f9a75a805021af5c5cc54fb5605c7ed25d1151fb /weed/mount/filehandle_read.go | |
| parent | 746092a60b3cefbe9617fe5f7e5a9a8d61fb8d13 (diff) | |
| download | seaweedfs-d65bb2c6df1a21ff2833717a16e549de971316b7.tar.xz seaweedfs-d65bb2c6df1a21ff2833717a16e549de971316b7.zip | |
mount: file handle locks entry better
related to https://github.com/chrislusf/seaweedfs/issues/2952
Diffstat (limited to 'weed/mount/filehandle_read.go')
| -rw-r--r-- | weed/mount/filehandle_read.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/weed/mount/filehandle_read.go b/weed/mount/filehandle_read.go index 5439b8bfd..88ab8612c 100644 --- a/weed/mount/filehandle_read.go +++ b/weed/mount/filehandle_read.go @@ -25,6 +25,9 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { fileFullPath := fh.FullPath() + fh.entryLock.Lock() + defer fh.entryLock.Unlock() + entry := fh.entry if entry == nil { return 0, io.EOF |
