Page MenuHomeFreeBSD

ext2fs: Add unsupported ext2fs features dmesg report
ClosedPublic

Authored by fsu on Jun 15 2017, 8:21 AM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 11, 3:52 AM
Unknown Object (File)
Apr 5 2024, 12:02 AM
Unknown Object (File)
Mar 30 2024, 10:28 PM
Unknown Object (File)
Mar 30 2024, 10:20 AM
Unknown Object (File)
Mar 8 2024, 9:17 PM
Unknown Object (File)
Mar 6 2024, 4:33 PM
Unknown Object (File)
Mar 4 2024, 5:29 PM
Unknown Object (File)
Mar 2 2024, 3:41 PM
Subscribers

Details

Summary

It could be useful to user to know which ext2 features currently are not supported by driver.
If user will know it he can try use to use tune2fs from e2fsprogs to remove unsupported features.

Test Plan

Output example:

/dev/md0 is 1GB

root@user:~ # mkfs.ext4 /dev/md0
root@user:~ # mount -t ext2fs /dev/md0 /mnt
root@user:~ # dmesg

WARNING: mount of md0 denied due to unsupported optional features: 64bit root@user:~ # mkfs.ext4 -O ^64bit /dev/md0 root@user:~ # mount -t ext2fs /dev/md0 /mnt WARNING: R/W mount of md0 denied due to unsupported optional features: huge_file uninit_groups dir_nlink

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This makes sense, but I am not sure we want to use a struct for that.
Not an objection, just a comment.

sys/fs/ext2fs/ext2_vfsops.c
296 ↗(On Diff #29642)

This had some similarity with our nitems() macro (sys/param.h)

Sorry, but I did not get your idea, what use instead of struct in this case?

fsu marked an inline comment as done.Jun 15 2017, 3:13 PM

Fix for() loops.

In D11208#231970, @thisisadrgreenthumb_gmail.com wrote:

Sorry, but I did not get your idea, what use instead of struct in this case?

Just thinking out loud ...
I don't like that we already have those as #defines and now we add them as a struct that works more like an enum.

As I said, it's not really an objection, I have no ideas at this time.

Ok, I will try locally implement it as enum, if it will be suitable, I will update review

Swap features defines to enums.

I have to say it looks elegant. The big doubt is if it's worth it.
kevlo@ uses it more than I do ... any opinion?

sys/fs/ext2fs/ext2_vfsops.c
309 ↗(On Diff #29706)

Wondering what happens if the number is not on the list: ext4 has been adding more features and it is likely we cannot keep the list up to date with new things coming.

I should add, that it is not critical change, because it does not have influence to functionality. So, we can really skip it.
From other side, user will know from dmesg. why his volume does not mounted, or mounted in ro instead of rw, so he can try to use debugfs in some cases, or in more rare case try to add new functionality by himself;)

In D11208#235170, @pfg wrote:

I have to say it looks elegant. The big doubt is if it's worth it.
kevlo@ uses it more than I do ... any opinion?

I think it's very useful. As we know, Ubuntu 16.04 and later versions use the
version 1.43 of e2fsprogs to create ext4 file system, which enables
64bit feature by default. After applying Fedor's patch I can see warning like:

WARNING: mount of da0s1 denied due to unsupported optional features: 64bit

Speaking of unsupported feature 64bit, I discussed this issue with pfg@,
Unfortunately we haven't documented this on the wiki.

Looks good to me, also tested on amd64.

This revision is now accepted and ready to land.Jun 29 2017, 7:54 AM

Actually, on second thoughts, I see no advantage in using the enums so I will be committing the previous version.

This revision was automatically updated to reflect the committed changes.