Skip to content

ext4: stop discarding the cause of directory read failures - #421

Merged
deitch merged 1 commit into
diskfs:masterfrom
austinvazquez:fix/ext4-readdir-error-wrapping
Aug 3, 2026
Merged

ext4: stop discarding the cause of directory read failures#421
deitch merged 1 commit into
diskfs:masterfrom
austinvazquez:fix/ext4-readdir-error-wrapping

Conversation

@austinvazquez

Copy link
Copy Markdown
Contributor

readDirWithMkdir's per-level readDirectory call dropped its error entirely, collapsing every possible cause -- checksum mismatches, unparseable dirents, htree rejections, extent tree failures, inode read failures -- into a single opaque "failed to read directory " with no detail at all. The mkSubdir wrapper a few lines above had the same problem. The root-level readDirectory call did include the error text (%v), but not in a form errors.Is/errors.As can reach.

Wrap all three with %w so the real cause survives to the caller.

readDirWithMkdir's per-level readDirectory call dropped its error
entirely, collapsing every possible cause -- checksum mismatches,
unparseable dirents, htree rejections, extent tree failures, inode
read failures -- into a single opaque "failed to read directory
<path>" with no detail at all. The mkSubdir wrapper a few lines above
had the same problem. The root-level readDirectory call did include
the error text (%v), but not in a form errors.Is/errors.As can reach.

Wrap all three with %w so the real cause survives to the caller.

Signed-off-by: Austin Vazquez <austin.vazquez@docker.com>

@deitch deitch left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This seems rather obvious in retrospect, doesn't it?

@deitch
deitch merged commit 5a7d171 into diskfs:master Aug 3, 2026
20 checks passed
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.

2 participants