Skip to content

writer: Clarifications around our usage of EROFS_NULL_ADDR#345

Merged
alexlarsson merged 1 commit intocomposefs:mainfrom
cgwalters:hardening-followup
Sep 16, 2024
Merged

writer: Clarifications around our usage of EROFS_NULL_ADDR#345
alexlarsson merged 1 commit intocomposefs:mainfrom
cgwalters:hardening-followup

Conversation

@cgwalters
Copy link
Copy Markdown
Contributor

  • Followup from review comments to clarify how this works
  • Rename the function to further reinforce it's not "empty" it's actually the special null addr
  • Actually use the EROFS_NULL_ADDR constant when we do the writing to make the connection more obvious
  • When reading back an erofs, at least verify that it's chunk based as extra validation.

- Followup from review comments to clarify how this works
- Rename the function to further reinforce it's not "empty"
  it's actually the special null addr
- Actually use the `EROFS_NULL_ADDR` constant when we do the
  writing to make the connection more obvious
- When reading back an erofs, at least verify that it's chunk
  based as extra validation.

Signed-off-by: Colin Walters <walters@verbum.org>
static int write_empty_chunks(struct lcfs_ctx_s *ctx, uint32_t chunk_count)
// Each chunk pointer appears as if it's filled with zeros using the dedicated
// EROFS_NULL_ADDR.
static int write_nullptr_chunks(struct lcfs_ctx_s *ctx, uint32_t chunk_count)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

although we usually call it as holes ;)

Copy link
Copy Markdown
Contributor

@hsiangkao hsiangkao left a comment

Choose a reason for hiding this comment

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

LGTM

@alexlarsson alexlarsson merged commit 84150dd into composefs:main Sep 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants