Merge pull request #3492 from filecoin-project/fix/readpiece-panic

ffiwrapper: Fix ReadPiece panic
This commit is contained in:
Łukasz Magiera 2020-09-02 18:59:22 +02:00 committed by GitHub
commit b774563ec3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -371,7 +371,11 @@ func (sb *Sealer) ReadPiece(ctx context.Context, writer io.Writer, sector abi.Se
maxPieceSize := abi.PaddedPieceSize(sb.ssize)
pf, err := openPartialFile(maxPieceSize, path.Unsealed)
if xerrors.Is(err, os.ErrNotExist) {
if err != nil {
if xerrors.Is(err, os.ErrNotExist) {
return false, nil
}
return false, xerrors.Errorf("opening partial file: %w", err)
}