Strictly error out on compressed filesystems for now#16
Conversation
There was a problem hiding this comment.
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_0Paddingand include it inFeatureIncompatAllso it’s recognized as a known feature. - Add an early
EroFS()check that errors out when the superblock indicates compression (FeatureIncompatLZ4_0PaddingorComprAlgs != 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.
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>
There was a problem hiding this comment.
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
ErrNotImplementedfor compressed filesystems based on superblock flags/fields. - Treat
FeatureIncompatLZ4_0Paddingas 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.erofsand assertErrNotImplemented.
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.
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.