summaryrefslogtreecommitdiff
path: root/internal/fusefrontend/root_node.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/fusefrontend/root_node.go')
-rw-r--r--internal/fusefrontend/root_node.go24
1 files changed, 24 insertions, 0 deletions
diff --git a/internal/fusefrontend/root_node.go b/internal/fusefrontend/root_node.go
new file mode 100644
index 0000000..94fd021
--- /dev/null
+++ b/internal/fusefrontend/root_node.go
@@ -0,0 +1,24 @@
+package fusefrontend
+
+import (
+ "time"
+
+ "github.com/rfjakob/gocryptfs/internal/tlog"
+)
+
+// reportMitigatedCorruption is used to report a corruption that was transparently
+// mitigated and did not return an error to the user. Pass the name of the corrupt
+// item (filename for OpenDir(), xattr name for ListXAttr() etc).
+// See the MitigatedCorruptions channel for more info.
+func (rn *RootNode) reportMitigatedCorruption(item string) {
+ if rn.MitigatedCorruptions == nil {
+ return
+ }
+ select {
+ case rn.MitigatedCorruptions <- item:
+ case <-time.After(1 * time.Second):
+ tlog.Warn.Printf("BUG: reportCorruptItem: timeout")
+ //debug.PrintStack()
+ return
+ }
+}