From 52c4864d849cbbb76d49d1a908025b77c7246bda Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Thu, 19 Nov 2026 20:53:14 +0100 Subject: fusefrontend: report mitigated corruptions via the context Replace the RootNode.MitigatedCorruptions channel with a callback that fsck attaches to the context of each operation via fusefrontend.WithCorruptionReporter(). The channel was needed when fsck went through the kernel, but now that fsck calls the node operations directly, the context is a better way: * Each report is attributed to the operation that caused it, so fsck no longer needs a watcher goroutine and the watchDone channel around every call. * reportMitigatedCorruption() no longer blocks for up to one second (and logs "BUG: reportCorruptItem: timeout") when nobody is listening. * A mounted filesystem has no reporter in the context, so reporting is a no-op there. readFileID() and doRead() now take a ctx. The write paths pass context.Background(), as fsck never writes. Co-Authored-By: Claude Opus 5.5 --- internal/fusefrontend/node_xattr.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'internal/fusefrontend/node_xattr.go') diff --git a/internal/fusefrontend/node_xattr.go b/internal/fusefrontend/node_xattr.go index 1470a2a..cbb0c37 100644 --- a/internal/fusefrontend/node_xattr.go +++ b/internal/fusefrontend/node_xattr.go @@ -153,13 +153,13 @@ func (n *Node) Listxattr(ctx context.Context, dest []byte) (uint32, syscall.Errn name, err := rn.decryptXattrName(curName) if err != nil { tlog.Warn.Printf("ListXAttr: invalid xattr name %q: %v", curName, err) - rn.reportMitigatedCorruption(curName) + reportMitigatedCorruption(ctx, curName) continue } // We *used to* encrypt ACLs, which caused a lot of problems. if isAcl(name) { tlog.Warn.Printf("ListXAttr: ignoring deprecated encrypted ACL %q = %q", curName, name) - rn.reportMitigatedCorruption(curName) + reportMitigatedCorruption(ctx, curName) continue } buf.WriteString(name + "\000") -- cgit v1.2.3