fix: print errors only when metacache status has errors (#11248)

This commit is contained in:
Harshavardhana
2021-01-08 03:22:19 -08:00
committed by GitHub
parent f21d650ed4
commit 4593b146be
4 changed files with 7 additions and 7 deletions

View File

@@ -654,11 +654,11 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
meta.endedCycle = intDataUpdateTracker.current()
meta, err = o.updateMetacacheListing(meta, rpc)
if meta.status == scanStateError {
logger.LogIf(ctx, err)
cancel()
exit = true
}
metaMu.Unlock()
logger.LogIf(ctx, err)
}
}()
@@ -772,7 +772,7 @@ func (er *erasureObjects) listPath(ctx context.Context, o listPathOptions) (entr
metaMu.Lock()
meta.error = err.Error()
meta.status = scanStateError
meta, err = o.updateMetacacheListing(meta, rpc)
meta, _ = o.updateMetacacheListing(meta, rpc)
metaMu.Unlock()
}
}

View File

@@ -1478,7 +1478,7 @@ func (s *xlStorage) ReadFileStream(ctx context.Context, volume, path string, off
if offset == 0 && globalStorageClass.GetDMA() == storageclass.DMAReadWrite {
file, err = disk.OpenFileDirectIO(filePath, os.O_RDONLY, 0666)
} else {
// Open the fileile fileor reading.
// Open the file for reading.
file, err = os.Open(filePath)
}
if err != nil {