Re: erofs: Question on unused fields in on-disk structs
From: Gao Xiang
Date: Mon Aug 19 2019 - 16:45:16 EST
On Mon, Aug 19, 2019 at 07:10:33PM +0200, Richard Weinberger wrote:
> struct erofs_super_block has "checksum" and "features" fields,
> but they are not used in the source.
> What is the plan for these?
Yes, both will be used laterly (features is used for compatible
features, we already have some incompatible features in 5.3).
> Same for i_checksum in erofs_inode_v1 and erofs_inode_v2.
checksum field apart from super_block has been reserved again
for linux-next. checksum in the super_block still exists and
will be used sooner.
The reason I discussed with Chao is
since EROFS is a read-only filesystem, we will develop block-based
checksum and integrity check to EROFS in the future version. It's
more effectively than adding such fields to all metadata (some metadata
is too large, we cannot calculate a checksum for the whole metadata
and compare at runtime, but we can do block-based metadata chksum
since EROFS is a read-only fs).
> At least the "features" field in the super block is something I'd
> expect to be used.
> ...such that you can have new filesystem features in future.
Of course, "features" is for compatible features, "requirements" is
for incompatible features. Both will be used in the future.