Skip to content

Recognise ZTAILPACKING bit in FeatureIncompat#34

Open
katexochen wants to merge 1 commit into
erofs:mainfrom
katexochen:fix/feature-incompat-bits
Open

Recognise ZTAILPACKING bit in FeatureIncompat#34
katexochen wants to merge 1 commit into
erofs:mainfrom
katexochen:fix/feature-incompat-bits

Conversation

@katexochen

Copy link
Copy Markdown

The on-disk EROFS_FEATURE_INCOMPAT_ZTAILPACKING bit (0x10) was missing from internal/disk's FeatureIncompat constants and from the FeatureIncompatAll accept list, so any image that sets it was rejected at Open with "unsupported incompatible feature 0x10" -- even when the fields needing ztailpacking semantics weren't touched by the read path.

Modern mkfs.erofs enables ztailpacking by default for compressed inodes, so this affected real-world images. Per-inode rejection of the actual inline-pcluster behaviour already happens inside internal/zerofs.ParseHeader (h_advise's INLINE_PCLUSTER bit -> "ztailpacking not supported" with ErrNotImplemented), matching the kernel's policy of accepting known incompat bits at the superblock level and gating real usage where features are actually consumed.

Two additional aliases match upstream's shared-bit naming: ComprHead2 shares bit 0x8 with DeviceTable, and Dedupe shares bit 0x20 with Fragments. 48BIT (0x80) and METABOX (0x100) are deliberately not added: they re-shape inode/metadata encoding and silently tolerating them would lead the reader to misinterpret structures.

The on-disk EROFS_FEATURE_INCOMPAT_ZTAILPACKING bit (0x10) was missing
from internal/disk's FeatureIncompat constants and from the
FeatureIncompatAll accept list, so any image that sets it was rejected
at Open with "unsupported incompatible feature 0x10" -- even when the
fields needing ztailpacking semantics weren't touched by the read
path.

Modern mkfs.erofs enables ztailpacking by default for compressed
inodes, so this affected real-world images. Per-inode rejection of
the actual inline-pcluster behaviour already happens inside
internal/zerofs.ParseHeader (h_advise's INLINE_PCLUSTER bit ->
"ztailpacking not supported" with ErrNotImplemented), matching the
kernel's policy of accepting known incompat bits at the superblock
level and gating real usage where features are actually consumed.

Two additional aliases match upstream's shared-bit naming: ComprHead2
shares bit 0x8 with DeviceTable, and Dedupe shares bit 0x20 with
Fragments. 48BIT (0x80) and METABOX (0x100) are deliberately not
added: they re-shape inode/metadata encoding and silently tolerating
them would lead the reader to misinterpret structures.

Assisted-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Paul Meyer <katexochen0@gmail.com>
@hsiangkao

Copy link
Copy Markdown
Member

In principle, FeatureIncompatAll shouldn’t set any feature that go-erofs doesn’t implement.
Although ztailpacking and device table share the same bit but they can be identified as whether (de)compression is implemented or not.
So I suggest not enabling ztailpacking without a workable compression implementation or do you have other use cases which needs that?

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