diff options
| author | Patrick Schmidt <patrick.schmidt@innogames.com> | 2022-08-31 18:27:53 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-08-31 09:27:53 -0700 |
| commit | a73e177ecff78aee1c59b3b57a296b10a778bc9e (patch) | |
| tree | 6d733b44cb9a059c6470ebb318595fc90dd5a9d8 /weed | |
| parent | 4a4ef3cc3c24d0c86defe82445448a567316cc36 (diff) | |
| download | seaweedfs-a73e177ecff78aee1c59b3b57a296b10a778bc9e.tar.xz seaweedfs-a73e177ecff78aee1c59b3b57a296b10a778bc9e.zip | |
Add an End-to-End workflow for FUSE mount (#3562)
* Add an e2e workflow to test FUSE mount
* Fix deadlocks during concurrent r/w
Diffstat (limited to 'weed')
| -rw-r--r-- | weed/mount/filehandle.go | 8 | ||||
| -rw-r--r-- | weed/mount/weedfs_file_read.go | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/weed/mount/filehandle.go b/weed/mount/filehandle.go index b2459d9e2..5d1552ce6 100644 --- a/weed/mount/filehandle.go +++ b/weed/mount/filehandle.go @@ -77,6 +77,10 @@ func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) { fh.entryLock.Lock() defer fh.entryLock.Unlock() + if fh.entry == nil { + return + } + // find the earliest incoming chunk newChunks := chunks earliestChunk := newChunks[0] @@ -86,10 +90,6 @@ func (fh *FileHandle) AddChunks(chunks []*filer_pb.FileChunk) { } } - if fh.entry == nil { - return - } - // pick out-of-order chunks from existing chunks for _, chunk := range fh.entry.Chunks { if lessThan(earliestChunk, chunk) { diff --git a/weed/mount/weedfs_file_read.go b/weed/mount/weedfs_file_read.go index 0375bc206..307ad5960 100644 --- a/weed/mount/weedfs_file_read.go +++ b/weed/mount/weedfs_file_read.go @@ -39,8 +39,8 @@ func (wfs *WFS) Read(cancel <-chan struct{}, in *fuse.ReadIn, buff []byte) (fuse return nil, fuse.ENOENT } - fh.entryLock.Lock() - defer fh.entryLock.Unlock() + fh.Lock() + defer fh.Unlock() offset := int64(in.Offset) totalRead, err := readDataByFileHandle(buff, fh, offset) |
