vfs: ignore file not found errors from Hash in Read.Release

There is nothing we can do about this at this point and this error can
happen when moving files so we ignore it to clean the logs up.
This commit is contained in:
Nick Craig-Wood 2020-05-04 12:18:28 +01:00
parent 14cab0fff0
commit 1a8c5708c5
1 changed files with 5 additions and 0 deletions

View File

@ -344,6 +344,11 @@ func (fh *ReadFileHandle) checkHash() error {
for hashType, dstSum := range fh.hash.Sums() {
srcSum, err := o.Hash(context.TODO(), hashType)
if err != nil {
if os.IsNotExist(errors.Cause(err)) {
// if it was file not found then at
// this point we don't care any more
continue
}
return err
}
if !hash.Equals(dstSum, srcSum) {