From 416d7ef86010a50a0975db20bf1fabc12059c391 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Wed, 3 Apr 2024 15:22:42 +0200 Subject: [PATCH] fix: curio: Pass taskID to WritePiece --- curiosrc/ffi/piece_funcs.go | 5 +++-- curiosrc/piece/task_park_piece.go | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/curiosrc/ffi/piece_funcs.go b/curiosrc/ffi/piece_funcs.go index 9bf4a504b..8b7df01ed 100644 --- a/curiosrc/ffi/piece_funcs.go +++ b/curiosrc/ffi/piece_funcs.go @@ -8,13 +8,14 @@ import ( "golang.org/x/xerrors" + "github.com/filecoin-project/lotus/lib/harmony/harmonytask" "github.com/filecoin-project/lotus/storage/sealer/storiface" ) -func (sb *SealCalls) WritePiece(ctx context.Context, pieceID storiface.PieceNumber, size int64, data io.Reader) error { +func (sb *SealCalls) WritePiece(ctx context.Context, taskID *harmonytask.TaskID, pieceID storiface.PieceNumber, size int64, data io.Reader) error { // todo: config(?): allow setting PathStorage for this // todo storage reservations - paths, done, err := sb.sectors.AcquireSector(ctx, nil, pieceID.Ref(), storiface.FTNone, storiface.FTPiece, storiface.PathSealing) + paths, done, err := sb.sectors.AcquireSector(ctx, taskID, pieceID.Ref(), storiface.FTNone, storiface.FTPiece, storiface.PathSealing) if err != nil { return err } diff --git a/curiosrc/piece/task_park_piece.go b/curiosrc/piece/task_park_piece.go index c8972fdaf..2085637f6 100644 --- a/curiosrc/piece/task_park_piece.go +++ b/curiosrc/piece/task_park_piece.go @@ -152,7 +152,7 @@ func (p *ParkPieceTask) Do(taskID harmonytask.TaskID, stillOwned func() bool) (d pnum := storiface.PieceNumber(pieceData.PieceID) - if err := p.sc.WritePiece(ctx, pnum, pieceRawSize, upr); err != nil { + if err := p.sc.WritePiece(ctx, &taskID, pnum, pieceRawSize, upr); err != nil { return false, xerrors.Errorf("write piece: %w", err) }