diff --git a/weed/mount/weedfs_file_copy_range.go b/weed/mount/weedfs_file_copy_range.go index f77330a7b..5123a320c 100644 --- a/weed/mount/weedfs_file_copy_range.go +++ b/weed/mount/weedfs_file_copy_range.go @@ -251,7 +251,11 @@ func (wfs *WFS) applyServerSideWholeFileCopyResult(fhIn, fhOut *FileHandle, dstP } fhOut.dirtyMetadata = false wfs.updateServerSideWholeFileCopyMetaCache(dstPath, entry) - wfs.invalidateCopyDestinationCache(fhOut.inode, dstPath) + // Note: we intentionally skip fuseServer.InodeNotify/EntryNotify here. + // This runs inside the CopyFileRange request handler; those notifies + // would write onto the same /dev/fuse fd the kernel is still waiting + // on for this request's reply, deadlocking the mount. The kernel will + // re-read attrs once its attr-cache TTL expires. } func (wfs *WFS) updateServerSideWholeFileCopyMetaCache(dstPath util.FullPath, entry *filer_pb.Entry) { @@ -501,16 +505,3 @@ func (wfs *WFS) filerCopyJWT() security.EncodedJwt { return security.GenJwtForFilerServer(wfs.option.FilerSigningKey, wfs.option.FilerSigningExpiresAfterSec) } -func (wfs *WFS) invalidateCopyDestinationCache(inode uint64, fullPath util.FullPath) { - if wfs.fuseServer != nil { - if status := wfs.fuseServer.InodeNotify(inode, 0, -1); status != fuse.OK { - glog.V(4).Infof("CopyFileRange invalidate inode %d: %v", inode, status) - } - dir, name := fullPath.DirAndName() - if parentInode, found := wfs.inodeToPath.GetInode(util.FullPath(dir)); found { - if status := wfs.fuseServer.EntryNotify(parentInode, name); status != fuse.OK { - glog.V(4).Infof("CopyFileRange invalidate entry %s: %v", fullPath, status) - } - } - } -} diff --git a/weed/mount/weedfs_link.go b/weed/mount/weedfs_link.go index 9413705c9..16952a33d 100644 --- a/weed/mount/weedfs_link.go +++ b/weed/mount/weedfs_link.go @@ -231,9 +231,9 @@ func (wfs *WFS) syncHardLinkSiblings(inode uint64, authoritativeEntry *filer_pb. glog.V(4).Infof("syncHardLinkSiblings update %s: %v", p, err) } } - if wfs.fuseServer != nil { - if status := wfs.fuseServer.InodeNotify(inode, 0, -1); status != fuse.OK { - glog.V(4).Infof("syncHardLinkSiblings invalidate inode %d: %v", inode, status) - } - } + // Note: we deliberately do NOT call fuseServer.InodeNotify here. That + // call would be made from the FUSE Link request handler goroutine, and + // writes onto the same /dev/fuse fd that the kernel is still waiting to + // read the Link reply from — causing a self-notify deadlock. The kernel + // will re-stat siblings once its attr-cache TTL expires. }