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/weedfs.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/weedfs.go')
| -rw-r--r-- | weed/mount/weedfs.go | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/weed/mount/weedfs.go b/weed/mount/weedfs.go index 2ab82b3ed..6437499bf 100644 --- a/weed/mount/weedfs.go +++ b/weed/mount/weedfs.go @@ -131,10 +131,11 @@ func (wfs *WFS) maybeReadEntry(inode uint64) (path util.FullPath, fh *FileHandle } var found bool if fh, found = wfs.fhmap.FindFileHandle(inode); found { - if fh.entry.Attributes == nil { - fh.entry.Attributes = &filer_pb.FuseAttributes{} + entry = fh.GetEntry() + if entry != nil && fh.entry.Attributes == nil { + entry.Attributes = &filer_pb.FuseAttributes{} } - return path, fh, fh.entry, fuse.OK + return path, fh, entry, fuse.OK } entry, status = wfs.maybeLoadEntry(path) return |
