From dff55a844c9e3703d7bd291878316eed7dac0c08 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 13 Nov 2026 01:46:12 -0800 Subject: [PATCH] mount: let a queued close reach the filer before linking the file With writeback caching a new file is created on the filer by its queued close, and a listed directory serves the source from the cache, so a link right after close updated a name the filer did not have yet and failed with EIO. Co-Authored-By: Claude Opus 5.5 --- weed/mount/weedfs_link.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/weed/mount/weedfs_link.go b/weed/mount/weedfs_link.go index d26a486914..0b6bf705bb 100644 --- a/weed/mount/weedfs_link.go +++ b/weed/mount/weedfs_link.go @@ -61,6 +61,10 @@ func (wfs *WFS) Link(cancel <-chan struct{}, in *fuse.LinkIn, name string, out * ctx, cancelFunc := ctxFromCancel(cancel) defer cancelFunc() + // A queued close may not have created or updated the source on the filer. + if !wfs.waitForPendingAsyncFlush(ctx, sourceInode) { + return fuse.EINTR + } oldEntry, _, status := wfs.maybeLoadEntry(ctx, oldEntryPath) if status != fuse.OK { return status