Skip to content

Strictly error out on compressed filesystems for now#16

Merged
dmcgowan merged 1 commit into
erofs:mainfrom
hsiangkao:corefmt
Mar 13, 2026
Merged

Strictly error out on compressed filesystems for now#16
dmcgowan merged 1 commit into
erofs:mainfrom
hsiangkao:corefmt

Conversation

@hsiangkao

Copy link
Copy Markdown
Member

Compressed filesystems are not part of the core format and are currently unimplemented.

Let's explicitly return an "unimplemented" error for filesystems including compressed data, allowing users to fall back to other methods.

Copilot AI review requested due to automatic review settings March 13, 2026 02:00
@hsiangkao hsiangkao requested a review from dmcgowan March 13, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown

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 makes compressed EROFS images fail fast during EroFS() initialization by treating compression-related superblock signals as “known but unimplemented”, returning ErrNotImplemented instead of deferring failures until inode access.

Changes:

  • Add FeatureIncompatLZ4_0Padding and include it in FeatureIncompatAll so it’s recognized as a known feature.
  • Add an early EroFS() check that errors out when the superblock indicates compression (FeatureIncompatLZ4_0Padding or ComprAlgs != 0).

Reviewed changes

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

File Description
internal/disk/types.go Introduces the LZ4 padding incompat feature constant and expands the known-incompat mask.
erofs.go Adds early rejection of compressed filesystems by returning an ErrNotImplemented-wrapping error.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread erofs.go Outdated
Comment thread erofs.go
Compressed filesystems are not part of the core format and are currently
unimplemented.

Let's explicitly return an "unimplemented" error for filesystems
including compressed data, allowing users to fall back to other methods.

Signed-off-by: Gao Xiang <hsiangkao@linux.alibaba.com>

Copilot AI left a comment

Copy link
Copy Markdown

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 makes EroFS image loading explicitly fail with an ErrNotImplemented-wrapping error when the superblock indicates compression is present/declared, since compressed filesystems are currently unsupported by this library.

Changes:

  • Add an explicit early-return ErrNotImplemented for compressed filesystems based on superblock flags/fields.
  • Treat FeatureIncompatLZ4_0Padding as a known incompatible feature so it can be surfaced with a targeted “compression unimplemented” error.
  • Extend tests to build a compressed EROFS image via mkfs.erofs and assert ErrNotImplemented.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
internal/disk/types.go Adds FeatureIncompatLZ4_0Padding and includes it in the known incompat feature mask.
erofs.go Rejects compressed filesystems early with an ErrNotImplemented-wrapping error.
erofs_test.go Adds a compressed-image test case and mkfs option plumbing (-z).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread erofs_test.go
@dmcgowan dmcgowan merged commit 0f2a9a4 into erofs:main Mar 13, 2026
8 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.

3 participants