common/rc: improve _require_metadata_journaling() for ext4
PATCH 1/1 common/rc: improve _require_metadata_journaling() for ext4
The code in _require_metadata_journaling() currently rejects ext4 file systems that have been created without a journal. However, an ext4 file system with a journal should also be rejected if the journal is not loaded and made available for use at mount time.
--- common/rc | 3 +++ 1 file changed, 3 insertions(+)
common/rc +3 -0
@@ -3057,6 +3057,9 @@ _require_metadata_journaling() _require_dumpe2fs $DUMPE2FS_PROG -h $DEV 2>&1 | grep -q has_journal || \ _notrun "$FSTYP on $DEV not configured with metadata journaling" + # ext4 may not have loaded a journal + echo $MOUNT_OPTIONS | grep -q noload && \ + _notrun "$FSTYP on $DEV not mounted with metadata journaling" ;; *) # by default we pass; if you need to, add your fs above!
Signature · 1 line
2.1.4
Quoted 15 lines · Eric Whitney
The code in
_require_metadata_journaling()currently rejects ext4 file systems that have been created without a journal. However, an ext4 file system with a journal should also be rejected if the journal is not loaded and made available for use at mount time.Signed-off-by Eric Whitney <[email protected]>--- common/rc | 3 +++ 1 file changed, 3 insertions(+)common/rc +0
-0
common/rc _require_metadata_journaling() · line 3062
Quoted 6 lines
common/rc +3
-0@@ -3057,6 +3057,9 @@ _require_metadata_journaling() _require_dumpe2fs $DUMPE2FS_PROG -h $DEV 2>&1 | grep -q has_journal || \ _notrun "$FSTYP on $DEV not configured with metadata journaling" + # ext4 may not have loaded a journal + echo $MOUNT_OPTIONS | grep -q noload && \ + _notrun "$FSTYP on $DEV not mounted with metadata journaling"
I think this can be done by the new helper _exclude_scratch_mount_option which was introduced recently, e.g.
_exclude_scratch_mount_option "noload"
Thanks,
Eryu
Quoted 10 lines
common/rc +0
-0;; *) # by default we pass; if you need to, add your fs above!Signature · 6 lines
2.1.4 -- To unsubscribe from this list: send the line "unsubscribe fstests" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Quoted 4 lines
I think this can be done by the new helper
_exclude_scratch_mount_optionwhich was introduced recently, e.g.
_exclude_scratch_mount_option "noload"
This function would be better named if it didn't include "_scratch", since it isn't scratch-specific. That would make it easier for the occasional contributor/reader to recognize it for what it is at a glance.
Also, its header comment references MKFS_OPTIONS rather than MOUNT_OPTIONS.
Thanks,
Eric
Quoted 3 lines
Thanks,
Eryu