mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-12-04 18:17:16 +01:00
mount: retain a recorded handle path only once it matches the file
A path read from the filer record was retained before the lookup checked it, so a stale one kept answering ESTALE without reading the record again. It is now retained right before LookupHandle, and never over a forgotten inode or path the table already holds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
1d0ff187c5
commit
9be2cb0b29
2 files changed
+10
-4
No files matched your search
@@ -203,16 +203,19 @@ func (i *InodeToPath) moveForgotten(sourcePath, targetPath util.FullPath) bool {
|
||||
}
|
||||
|
||||
// RememberForgotten retains path as that of a forgotten inode, one an earlier
|
||||
// mount handed out, unless the inode is live.
|
||||
// mount handed out, unless the table already knows the inode or the path.
|
||||
func (i *InodeToPath) RememberForgotten(inode uint64, path util.FullPath) {
|
||||
i.Lock()
|
||||
defer i.Unlock()
|
||||
if i.forgotten == nil {
|
||||
if i.forgotten == nil || i.forgotten.Contains(inode) {
|
||||
return
|
||||
}
|
||||
if _, live := i.inode2path[inode]; live {
|
||||
return
|
||||
}
|
||||
if _, taken := i.forgottenInodes[path]; taken {
|
||||
return
|
||||
}
|
||||
i.forgotten.Add(inode, path)
|
||||
i.forgottenInodes[path] = inode
|
||||
}
|
||||
|
||||
@@ -58,7 +58,11 @@ func (wfs *WFS) Lookup(cancel <-chan struct{}, header *fuse.InHeader, name strin
|
||||
}
|
||||
inode := possibleInode
|
||||
if name == "." {
|
||||
if !sameFile(inode, fullFilePath, localEntry) || !wfs.inodeToPath.LookupHandle(fullFilePath, inode, localEntry.IsDirectory()) {
|
||||
if !sameFile(inode, fullFilePath, localEntry) {
|
||||
return fuse.Status(syscall.ESTALE)
|
||||
}
|
||||
wfs.inodeToPath.RememberForgotten(inode, fullFilePath)
|
||||
if !wfs.inodeToPath.LookupHandle(fullFilePath, inode, localEntry.IsDirectory()) {
|
||||
return fuse.Status(syscall.ESTALE)
|
||||
}
|
||||
} else {
|
||||
@@ -103,7 +107,6 @@ func (wfs *WFS) resolveDotName(ctx context.Context, nodeId uint64, name string)
|
||||
if !forgotten.IsUnder(util.FullPath(wfs.option.FilerMountRootPath)) {
|
||||
return "", 0, fuse.Status(syscall.ESTALE)
|
||||
}
|
||||
wfs.inodeToPath.RememberForgotten(nodeId, forgotten)
|
||||
}
|
||||
if inode, known := wfs.inodeToPath.GetInode(forgotten); known && inode != nodeId {
|
||||
return "", 0, fuse.Status(syscall.ESTALE)
|
||||
|
||||
Reference in new issue
Block a user