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.
This commit is contained in:
Jakob Unterwurzacher 2021-08-16 17:13:14 +02:00
parent dd24fed532
commit b8d78d6a31

View File

@ -18,6 +18,8 @@ import (
"log" "log"
"sync" "sync"
"syscall" "syscall"
"github.com/rfjakob/gocryptfs/internal/tlog"
) )
const ( const (
@ -56,7 +58,11 @@ func New() *InoMap {
} }
} }
var spillWarn sync.Once
func (m *InoMap) spill(in QIno) (out uint64) { 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] out, found := m.spillMap[in]
if found { if found {
return out | spillBit return out | spillBit