From b8d78d6a3153f0ebf01e11426bd28453c7b8b522 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Mon, 16 Aug 2021 17:13:14 +0200 Subject: inomap: warn on first use of spillMap We normally should not need it, warn if we do. As the tests run with -wpanic, we would catch it. --- internal/inomap/inomap.go | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'internal') diff --git a/internal/inomap/inomap.go b/internal/inomap/inomap.go index 82d50b0..bd20e0d 100644 --- a/internal/inomap/inomap.go +++ b/internal/inomap/inomap.go @@ -18,6 +18,8 @@ import ( "log" "sync" "syscall" + + "github.com/rfjakob/gocryptfs/internal/tlog" ) const ( @@ -56,7 +58,11 @@ func New() *InoMap { } } +var spillWarn sync.Once + func (m *InoMap) spill(in QIno) (out uint64) { + spillWarn.Do(func() { tlog.Warn.Printf("InoMap: opening spillMap for %v", in) }) + out, found := m.spillMap[in] if found { return out | spillBit -- cgit v1.2.3