Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1807010

Summary: Mke2fs: cannot parse recent mke2fs.conf file
Product: Red Hat Enterprise Linux 8 Reporter: Pino Toscano <ptoscano>
Component: augeasAssignee: Richard W.M. Jones <rjones>
Status: CLOSED MIGRATED QA Contact: YongkuiGuo <yoguo>
Severity: medium Docs Contact:
Priority: medium    
Version: 8.1CC: rjones, ymankad, yoguo
Target Milestone: rcKeywords: MigratedToJIRA, Regression, Reopened, Triaged
Target Release: ---Flags: pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2023-09-22 12:19:41 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Pino Toscano 2020-02-25 13:16:48 UTC
Description of problem:
After the rebase of e2fsprogs to 1.45.4 done in version e2fsprogs-1.45.4-1.el8.x86_64, the newly shipped /etc/mke2fs.conf cannot be parsed anymore by the Mke2fs lens:

$ augtool print /augeas//error | grep /etc/mke2fs.conf
/augeas/files/etc/mke2fs.conf/error = "parse_failed"
/augeas/files/etc/mke2fs.conf/error/pos = "384"
/augeas/files/etc/mke2fs.conf/error/line = "17"
/augeas/files/etc/mke2fs.conf/error/char = "0"
/augeas/files/etc/mke2fs.conf/error/lens = "/usr/share/augeas/lenses/dist/mke2fs.aug:135.10-.49:"
/augeas/files/etc/mke2fs.conf/error/message = "Get did not match entire input"

The issues are various:
- all the options available for filesystems are not handled (inside the [fs_types] stanza)
- boolean values are not parsed correctly (i.e. all the possible values for them)
- quoted values are not handled

I fixed some of the issues in the past with an already-merged MR [1], and a more recent one handles almost all the remaining issues [2].

Version-Release number of selected component (if applicable):
augeas-1.12.0-5.el8

Steps to Reproduce:
$ augtool print /augeas//error | grep /etc/mke2fs.conf

Actual results:
/augeas/files/etc/mke2fs.conf/error = "parse_failed"
/augeas/files/etc/mke2fs.conf/error/pos = "384"
/augeas/files/etc/mke2fs.conf/error/line = "17"
/augeas/files/etc/mke2fs.conf/error/char = "0"
/augeas/files/etc/mke2fs.conf/error/lens = "/usr/share/augeas/lenses/dist/mke2fs.aug:135.10-.49:"
/augeas/files/etc/mke2fs.conf/error/message = "Get did not match entire input"

Expected results:
- no output for errors
- `augtool print /files/etc/mke2fs.conf/` that prints the actual content of the file

Comment 2 Pino Toscano 2020-12-25 17:52:29 UTC
*** Bug 1910838 has been marked as a duplicate of this bug. ***

Comment 3 Richard W.M. Jones 2021-07-06 16:03:18 UTC
Upstream fix is: c4b529fb4a2f8d88844396e33c17a1d670a44b41

Comment 5 RHEL Program Management 2021-08-25 07:27:07 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 6 Richard W.M. Jones 2021-08-25 09:11:20 UTC
Stupid stupid stale bug process.

Comment 8 Klaus Heinrich Kiwi 2021-08-31 18:41:41 UTC
(In reply to Richard W.M. Jones from comment #3)
> Upstream fix is: c4b529fb4a2f8d88844396e33c17a1d670a44b41

Do we know if this fix was included in RHEL9 Beta?

Comment 9 Richard W.M. Jones 2021-08-31 18:46:18 UTC
(In reply to Klaus Heinrich Kiwi from comment #8)
> (In reply to Richard W.M. Jones from comment #3)
> > Upstream fix is: c4b529fb4a2f8d88844396e33c17a1d670a44b41
> 
> Do we know if this fix was included in RHEL9 Beta?

It is ...

... but this bug is for RHEL 8 and that does not
contain the fix.

Comment 12 YongkuiGuo 2022-01-13 02:53:43 UTC
Hi rjones, I failed to verify this bug with augeas-1.12.0-7.el8 package.

Steps:

On rhel8.6 host:
# rpm -q augeas
augeas-1.12.0-7.el8.x86_64

# augtool print /files/etc/mke2fs.conf
# augtool print /augeas//error | grep /etc/mke2fs.conf
/augeas/files/etc/mke2fs.conf/error = "parse_failed"
/augeas/files/etc/mke2fs.conf/error/pos = "384"
/augeas/files/etc/mke2fs.conf/error/line = "17"
/augeas/files/etc/mke2fs.conf/error/char = "0"
/augeas/files/etc/mke2fs.conf/error/lens = "/usr/share/augeas/lenses/dist/mke2fs.aug:187.10-.57:"
/augeas/files/etc/mke2fs.conf/error/message = "Get did not match entire input"

Comment 14 Richard W.M. Jones 2022-01-13 08:19:46 UTC
OK I see - I tested this against the Fedora mke2fs.conf, not the RHEL one.

The RHEL one has additional entries:

@@ -14,6 +14,16 @@
 		features = has_journal,extent,huge_file,flex_bg,metadata_csum,64bit,dir_nlink,extra_isize
 		inode_size = 256
 	}
+	rhel6_ext4 = {
+		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize
+		inode_size = 256
+		enable_periodic_fsck = 1
+		default_mntopts = ""
+	}
+	rhel7_ext4 = {
+		features = has_journal,extent,huge_file,flex_bg,uninit_bg,dir_nlink,extra_isize,64bit
+		inode_size = 256
+	}
 	small = {
 		blocksize = 1024
 		inode_size = 128

Elsewhere in the file, default_mntopts is a list, such as:

        default_mntopts = acl,user_xattr

This is also what is documented in https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git/tree/misc/mke2fs.conf.in#n3

But in one of the entries above, it's an empty string:

	default_mntopts = ""

The hand-written parsing code in e2fsprogs is very difficult to follow.  All the examples
seem to indicate the quotes are wrong, but obviously it works in mke2fs.  I will have to
ask the e2fsprogs team for their opinion.

Comment 15 Richard W.M. Jones 2022-01-13 08:32:03 UTC
I found out by experimentation how this works.  default_mntopts is not
treated as a list internally, but as a string.  If quotes are present then
they are removed.

So:
default_mntopts = ""      => parsed as empty string
default_mntopts = "abc"   => parsed as string "abc"
default_mntopts = abc,def => parsed as string "abc,def"

The augeas parser is wrong and needs an additional fix.

Comment 16 YongkuiGuo 2022-01-13 09:28:05 UTC
rjones, thanks for the explanation.

Comment 17 Richard W.M. Jones 2022-01-13 10:53:17 UTC
Well my attempt to fix this has so far failed, so I guess we will have
to bump this to the next release.  The actual -7 package is still fine.

Further discussion on:
https://github.com/hercules-team/augeas/pull/661

Comment 18 YongkuiGuo 2022-01-20 05:07:11 UTC
(In reply to Richard W.M. Jones from comment #17)
> Well my attempt to fix this has so far failed, so I guess we will have
> to bump this to the next release.  The actual -7 package is still fine.
> 
rjones, could you help remove this bug from the erratum? Thanks.

Comment 26 RHEL Program Management 2023-01-01 07:27:44 UTC
After evaluating this issue, there are no plans to address it further or fix it in an upcoming release.  Therefore, it is being closed.  If plans change such that this issue will be fixed in an upcoming release, then the bug can be reopened.

Comment 27 YongkuiGuo 2023-01-03 03:57:17 UTC
Reopen this bug since it is closed automatically by RHEL stale bug policy.

Comment 30 RHEL Program Management 2023-09-22 12:18:30 UTC
Issue migration from Bugzilla to Jira is in process at this time. This will be the last message in Jira copied from the Bugzilla bug.

Comment 31 RHEL Program Management 2023-09-22 12:19:41 UTC
This BZ has been automatically migrated to the issues.redhat.com Red Hat Issue Tracker. All future work related to this report will be managed there.

Due to differences in account names between systems, some fields were not replicated.  Be sure to add yourself to Jira issue's "Watchers" field to continue receiving updates and add others to the "Need Info From" field to continue requesting information.

To find the migrated issue, look in the "Links" section for a direct link to the new issue location. The issue key will have an icon of 2 footprints next to it, and begin with "RHEL-" followed by an integer.  You can also find this issue by visiting https://issues.redhat.com/issues/?jql= and searching the "Bugzilla Bug" field for this BZ's number, e.g. a search like:

"Bugzilla Bug" = 1234567

In the event you have trouble locating or viewing this issue, you can file an issue by sending mail to rh-issues. You can also visit https://access.redhat.com/articles/7032570 for general account information.