Skip to content

fix: handle partial reads in UnpadReader for non-power-of-2 pieces#13306

Merged
rvagg merged 1 commit intomasterfrom
rvagg/unpad-reader-oddsize-read-fix
Sep 5, 2025
Merged

fix: handle partial reads in UnpadReader for non-power-of-2 pieces#13306
rvagg merged 1 commit intomasterfrom
rvagg/unpad-reader-oddsize-read-fix

Conversation

@rvagg
Copy link
Copy Markdown
Member

@rvagg rvagg commented Sep 4, 2025

Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619
Ref: filecoin-project/boost#2020

Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619
Ref: filecoin-project/boost#2020

- Keep PR #12884's buffer overflow fix (clamp to buffer size)
- Add graceful handling of io.ErrUnexpectedEOF for partial pieces
- Fixes boost EOF errors when reading 7MB deals in 8MB sectors
- Add test for partial piece reading edge case
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR fixes partial read handling in UnpadReader for non-power-of-2 piece sizes to resolve boost EOF errors when reading 7MB deals in 8MB sectors.

  • Adds graceful handling of io.ErrUnexpectedEOF to process partial pieces with complete 128-byte chunks
  • Updates error messages to be more descriptive about read failures
  • Adds comprehensive test coverage for the partial piece reading edge case

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
storage/sealer/fr32/readers.go Enhanced readInner method to handle partial reads and EOF conditions gracefully
storage/sealer/fr32/readers_test.go Added test case for partial piece reading scenario

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Comment thread storage/sealer/fr32/readers.go
Comment thread storage/sealer/fr32/readers_test.go
@rvagg rvagg added the skip/changelog This change does not require CHANGELOG.md update label Sep 4, 2025
Copy link
Copy Markdown
Contributor

@tediou5 tediou5 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, yes. Good catch.

@github-project-automation github-project-automation Bot moved this from 📌 Triage to ✔️ Approved by reviewer in FilOz Sep 4, 2025
@rvagg rvagg merged commit 5021692 into master Sep 5, 2025
106 of 107 checks passed
@rvagg rvagg deleted the rvagg/unpad-reader-oddsize-read-fix branch September 5, 2025 03:23
@github-project-automation github-project-automation Bot moved this from ✔️ Approved by reviewer to 🎉 Done in FilOz Sep 5, 2025
BigLep pushed a commit that referenced this pull request Sep 5, 2025
…13306)

Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619
Ref: filecoin-project/boost#2020

- Keep PR #12884's buffer overflow fix (clamp to buffer size)
- Add graceful handling of io.ErrUnexpectedEOF for partial pieces
- Fixes boost EOF errors when reading 7MB deals in 8MB sectors
- Add test for partial piece reading edge case
TippyFlitsUK pushed a commit that referenced this pull request Sep 5, 2025
…13306)

Ref: https://filecoinproject.slack.com/archives/CP50PPW2X/p1756905471593619
Ref: filecoin-project/boost#2020

- Keep PR #12884's buffer overflow fix (clamp to buffer size)
- Add graceful handling of io.ErrUnexpectedEOF for partial pieces
- Fixes boost EOF errors when reading 7MB deals in 8MB sectors
- Add test for partial piece reading edge case
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip/changelog This change does not require CHANGELOG.md update

Projects

Status: 🎉 Done

Development

Successfully merging this pull request may close these issues.

5 participants