Re: [f2fs-dev] [PATCH] f2fs: fix to do sanity with enabled features in image

From: Ju Hyung Park
Date: Mon Apr 29 2019 - 16:54:16 EST


Hi Chao and Jaegeuk,

On Wed, Apr 24, 2019 at 6:49 PM Chao Yu <yuchao0@xxxxxxxxxx> wrote:
>
> This patch fixes to do sanity with enabled features in image, if
> there are features kernel can not recognize, just fail the mount.
>

Surprised to see that this wasn't implemented yet.
I was actually about to suggest this method to prevent mounting of the
new extended bitmap layout images altogether for older kernels(by
renaming the new, fixed layout to v2 or something), but looks like
that isn't an option. :(

Also, something similar should be also done with fsck, if not already.
The results from using older fsck with images with newer features
would be disastrous.

I'm still very busy currently with my other projects.
Sorry for the delays in testing new patchsets for layout fixes.

And I apologize in advance in case I miss the Linux 5.2 merge window
deadline, but I'd like to see it being fixed properly before shipping
those patches to production.

> + /* check whether kernel supports all features */
> + if (le32_to_cpu(raw_super->feature) & (~F2FS_ALL_FEATURES)) {
> + f2fs_msg(sb, KERN_INFO,
> + "Unsupported feature:%u: supported:%u",
> + le32_to_cpu(raw_super->feature),
> + F2FS_ALL_FEATURES);
> + return 1;
> + }

This should probably be a KERN_ERR instead of KERN_INFO.

Thanks.