aboutsummaryrefslogtreecommitdiff
path: root/weed/mount/weedfs_dir_lookup.go
diff options
context:
space:
mode:
authorChris Lu <chrislusf@users.noreply.github.com>2022-12-05 12:32:27 -0800
committerGitHub <noreply@github.com>2022-12-05 12:32:27 -0800
commitdac9c28d05cd61402cf5fbac42507b49b5a4f7a5 (patch)
treea0ca34e1f223df0b7ace31bd3a1155389611301c /weed/mount/weedfs_dir_lookup.go
parent38479b6329ead2d2e35850bd894bf9d8e030f09f (diff)
downloadseaweedfs-dac9c28d05cd61402cf5fbac42507b49b5a4f7a5.tar.xz
seaweedfs-dac9c28d05cd61402cf5fbac42507b49b5a4f7a5.zip
Revert "refactor: moved to locked entry" (#4035)
* Revert "refactor: moved to locked entry" This reverts commit 94bc9afd9d3f8e049219c1cdc9f0d6e0eb4cf456. * only add LockedEntry, no changes to entryLock * fix compilation
Diffstat (limited to 'weed/mount/weedfs_dir_lookup.go')
-rw-r--r--weed/mount/weedfs_dir_lookup.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/mount/weedfs_dir_lookup.go b/weed/mount/weedfs_dir_lookup.go
index 015f04e99..2d3ea8ae5 100644
--- a/weed/mount/weedfs_dir_lookup.go
+++ b/weed/mount/weedfs_dir_lookup.go
@@ -58,10 +58,12 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
inode := wfs.inodeToPath.Lookup(fullFilePath, localEntry.Crtime.Unix(), localEntry.IsDirectory(), len(localEntry.HardLinkId) > 0, localEntry.Inode, true)
if fh, found := wfs.fhmap.FindFileHandle(inode); found {
+ fh.entryLock.Lock()
if entry := fh.GetEntry(); entry != nil {
glog.V(4).Infof("lookup opened file %s size %d", dirPath.Child(localEntry.Name()), filer.FileSize(entry))
localEntry = filer.FromPbEntry(string(dirPath), entry)
}
+ fh.entryLock.Unlock()
}
wfs.outputFilerEntry(out, inode, localEntry)