possible fix for rare panic

This commit is contained in:
ston1th 2022-10-08 13:45:12 +02:00
commit 88861102fd
4 changed files with 20 additions and 17 deletions

View file

@ -4,6 +4,7 @@ package fs
import (
"cachefs/pkg/provider"
"cachefs/pkg/provider/crypto"
"context"
"errors"
"io"
@ -95,13 +96,13 @@ func (f *File) Read(p []byte) (n int, err error) {
return
}
if err != nil {
if !IsIOErr(err) {
if !IsIOErr(err) && err != crypto.ErrDecrypt {
log.Error(err, "error reading cache file")
return
}
n, err = f.readSource(p)
if err != nil {
log.Error(err, "error reading source file")
log.Error(err, "error reading fallback source file")
return
}
}