Created attachment 164769 [details] Patch to add support for the EXT2F_INCOMPAT_RECOVER flag If a disk with the EXT4 filesystem wasn't cleanly unmounted, it will have the EXT2F_INCOMPAT_RECOVER flag set on its feature flags, visible as "needs_recovery" in the "Filesystem features" of "tune2fs -l /dev/<disk>". Our ext2fs module doesn't know about this flag, and ends up treating a disk in this state as having unsupported features, logging the inappropriate and confusing message: WARNING: mount of <disk> denied due to unsupported optional features to dmesg and unable to mount it until fsck.ext4 even if mounting read-only or forced. My attached patch adds support for this flag and treats it as supported, warning if the filesystem wasn't cleanly unmounted like it already does with the other 2 ways of marking it as such.
I'll take it ...
Created attachment 164776 [details] Ignore EXT2F_INCOMPAT_RECOVER when mounting ext4 The flag appears only in ext4 and appears to be realated with journalling, neither of which we actually support fully. This simpler patch should "fix" it.
A commit references this bug: Author: pfg Date: Tue Dec 29 15:51:52 UTC 2015 New revision: 292872 URL: https://svnweb.freebsd.org/changeset/base/292872 Log: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 MFC after: 1 week Changes: head/sys/fs/ext2fs/ext2fs.h
Hi Pedro. Thank you, your patch gets the filesystem to mount. However there is no warning that it hasn't been cleanly unmounted.
(In reply to Damjan Jovanovic from comment #4) Hi Damjan; Yes, this is consistent with us ignoring the feature: read-only operation should not touch the disk and warning only when unmounting would give the impression that *we* somehow corrupted the information. Let the rw implementation (in linux) deal with it. An alternative would have been to simply not mount the disk and let the user deal with ext4 fsck (I think that was what was happening originally).
A commit references this bug: Author: pfg Date: Wed Jan 6 16:25:01 UTC 2016 New revision: 293236 URL: https://svnweb.freebsd.org/changeset/base/293236 Log: MFC r292872: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 Changes: _U stable/10/ stable/10/sys/fs/ext2fs/ext2fs.h
A commit references this bug: Author: pfg Date: Wed Jan 6 16:27:18 UTC 2016 New revision: 293237 URL: https://svnweb.freebsd.org/changeset/base/293237 Log: MFC r292872: ext2: recognize ext4 INCOMPAT_RECOVER flag This is a flag specific for journalling in ext4. Add it to the list of ext4 features we ignore for read-only purposes. PR: 205668 Changes: _U stable/9/sys/ _U stable/9/sys/fs/ stable/9/sys/fs/ext2fs/ext2fs.h
This should be solved in all supported FreeBSD versions now. Thanks!