Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-92749

fstab-generator: fix options in systemd.mount-extra= arg

Linking RHIVOS CVEs to...Migration: Automation ...Sync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-10.1
    • rhel-9.6, rhel-10.0, rhel-10.1, rhel-9.7
    • systemd
    • None
    • No
    • Moderate
    • ZStream
    • 06fadc4286fee6a7505a88659e5ae2e6f3ee60ba
    • rhel-systemd
    • ssg_core_services
    • 3
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Approved Blocker
    • None
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • All
    • None

      What were you trying to do that didn't work?

      Boot a system using command line mount units (systemd.mount-extra=WHAT:WHERE:FSTYPE:OPTIONS) to specify an auxiliary mount. The format of the options field follows the fstab convention: a comma-separated list of file system mount options to apply.

      What is the impact of this issue to you?

      All file system options after the first comma-separated option are silently discarded. If subsequent mount options are essential for the mount to succeed the mount unit will fail, potentially blocking boot and leading to emergency mode.

      Please provide the package NVR for which the bug is seen:

      systemd-257-9.el10_0.1.x86_64, systemd-257-11.el10

      How reproducible is this bug?:

      100%

      Steps to reproduce

      Steps without breaking boot that demonstrate the problem (x- options are used since they are passed through but ignored by mount):

      1. Set up a device with a file system for the test: E.g. on an lvm installation with free space run lvcreate -n mounttest -L1g rhel, mkfs.xfs /dev/rhel/mounttest
      2. Append e.g. "systemd.mount-extra=/dev/rhel/mounttest:/mnt:xfs:defaults,x-foo,x-bar,x-baz" to the kernel command line for the next boot (either modify the BLS snippet or use grub2 'e' command and append manually while rebooting)
      3. Reboot the system
      4. Inspect the resulting mount unit in /run/systemd/generator/mnt.mount

        Expected results

        # Automatically generated by systemd-fstab-generator
        
        [Unit]
        Documentation=man:fstab(5) man:systemd-fstab-generator(8)
        SourcePath=/proc/cmdline
        Before=local-fs.target
        Requires=systemd-fsck@dev-rhel-mounttest.service
        After=systemd-fsck@dev-rhel-mounttest.service
        After=blockdev@dev-rhel-mounttest.target
        
        [Mount]
        What=/dev/rhel/mounttest
        Where=/mnt
        Type=xfs
        Options=defaults,x-foo,x-bar,x-baz
        

      Actual results

      No Options line present in mount unit:

      # grep Options /run/systemd/generator/mnt.mount | wc -l
      0
      

       

      # Automatically generated by systemd-fstab-generator
      
      [Unit]
      Documentation=man:fstab(5) man:systemd-fstab-generator(8)
      SourcePath=/proc/cmdline
      Before=local-fs.target
      Requires=systemd-fsck@dev-rhel-mounttest.service
      After=systemd-fsck@dev-rhel-mounttest.service
      After=blockdev@dev-rhel-mounttest.target
      
      [Mount]
      What=/dev/rhel/mounttest
      Where=/mnt
      Type=xfs
      

      Upstream status

      This is fixed upstream since April via https://github.com/systemd/systemd/pull/37037 (commit 06fadc42)

      Additional information

      This was observed while testing snapshot boot using command line mount units in conjunction with Stratis file system mounts which depend on x-systemd.requires=stratis-fstab-setup@POOL_UUID for boot time set up. The Stratis documentation suggests configuring fstab lines as for e.g.:

      /dev/stratis/p1/fs1    /where    xfs    defaults,x-systemd.requires=stratis-fstab-setup@POOL_UUID,... 0 0
      

      When translated to systemd.mount-extra only the defaults is parsed by systemd-fstab-generator, leading to boot failure since the stratis-fstab-setup service is mandatory to pull in the required stratisd(,-min) service.

              systemd-maint systemd maint mailing list
              rhn-support-bmr Bryn Reeves
              systemd maint mailing list systemd maint mailing list
              Frantisek Sumsal Frantisek Sumsal
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated: