diff --git a/extern/storage-sealing/input.go b/extern/storage-sealing/input.go index 7243c472b..8e9118605 100644 --- a/extern/storage-sealing/input.go +++ b/extern/storage-sealing/input.go @@ -315,7 +315,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec m.inputLk.Unlock() select { case <-pp.doneCh: - res := pp.resp.Load().(*pieceAcceptResp) + res := pp.resp return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err case <-ctx.Done(): return api.SectorOffset{}, ctx.Err() @@ -331,7 +331,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec assigned: false, } pp.accepted = func(sn abi.SectorNumber, offset abi.UnpaddedPieceSize, err error) { - pp.resp.Store(&pieceAcceptResp{sn, offset, err}) + pp.resp = &pieceAcceptResp{sn, offset, err} close(pp.doneCh) } @@ -345,7 +345,7 @@ func (m *Sealing) SectorAddPieceToAny(ctx context.Context, size abi.UnpaddedPiec select { case <-doneCh: - res := pp.resp.Load().(*pieceAcceptResp) + res := pp.resp return api.SectorOffset{Sector: res.sn, Offset: res.offset.Padded()}, res.err case <-ctx.Done(): return api.SectorOffset{}, ctx.Err() diff --git a/extern/storage-sealing/sealing.go b/extern/storage-sealing/sealing.go index abfed55c7..907d7cdfd 100644 --- a/extern/storage-sealing/sealing.go +++ b/extern/storage-sealing/sealing.go @@ -4,7 +4,6 @@ import ( "context" "errors" "sync" - "sync/atomic" "time" "github.com/ipfs/go-cid" @@ -149,7 +148,7 @@ type pieceAcceptResp struct { type pendingPiece struct { doneCh chan struct{} - resp atomic.Value + resp *pieceAcceptResp size abi.UnpaddedPieceSize deal api.PieceDealInfo