Bug 2155314

Summary: Allow mount and device units with very long paths
Product: Red Hat Enterprise Linux 8 Reporter: Amey <abetkike>
Component: systemdAssignee: systemd-maint
Status: CLOSED DUPLICATE QA Contact: Frantisek Sumsal <fsumsal>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.7CC: dtardon, systemd-maint-list
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: ---   
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-01-05 14:01:38 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 Amey 2022-12-20 19:17:25 UTC
Description of problem:

** I am cloning this BZ from BZ #1779813 which was for RHEL 7, as the customer has confirmed that the fix is NOT needed in RHEL 7 but is now needed in RHEL 8 I am creating this new BZ to track changes in RHEL 8 **

A customer has a SAS Expander that expands their devices out to a name longer than 256 characters when the path is exploded.

    # systemd-escape /devices/pci0000:00/0000:00:02.0/0000:02:00.0/host10/port-10:0/expander-10:0/port-10:0:0/expander-10:1/port-10:1:0/expander-10:2/port-10:2:0/expander-10:3/port-10:3:13/end_device-10:3:13/target10:0:89/10:0:89:0/scsi_device/10:0:89:0 | wc
	  1       1     263

This causes the systemd to fail on the device with:

    systemd: Failed to set up device unit: Invalid argument

And then the systemd job times out and the mounts fail.

This value appears to be arbitrarily increased over time.  We gave the customer a test patch that raised UNIT_NAME_MAX in shared/unit-name.h to 512 and it resolved their issue.

Requesting that this value be raised to 512.


Version-Release number of selected component (if applicable):
systemd-239-68.el8.x86_64

How reproducible:
Every time if the device name is over 256 characters.


Steps to Reproduce:
1.  Attach a device with a path over 256 characters.
2.  Boot the server
3.  Check the logs for errors.

Actual results:

systemd errors with:

    systemd: Failed to set up device unit: Invalid argument

And times out the device.

Expected results:

System boots without any issues.

Additional info:

Comment 1 David Tardon 2023-01-05 14:01:38 UTC

*** This bug has been marked as a duplicate of bug 1940973 ***