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
1 changed files with 6 additions and 0 deletions

View File

@ -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