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 2213653

Summary: sys_wwid and sys_serial device ids with spaces
Product: Red Hat Enterprise Linux 9 Reporter: David Teigland <teigland>
Component: lvm2Assignee: David Teigland <teigland>
lvm2 sub component: Devices, Filtering and Stacking QA Contact: cluster-qe <cluster-qe>
Status: CLOSED MIGRATED Docs Contact:
Severity: high    
Priority: high CC: agk, heinzm, jbrassow, msnitzer, prajnoha, zkabelac
Version: 9.2Keywords: MigratedToJIRA, Triaged
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-09-23 19:14:21 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 David Teigland 2023-06-08 21:15:08 UTC
Description of problem:

lvm should ignore leading and trailing spaces on sys_wwid and sys_serial device ids, and replace spaces in the middle with underscores.  For t10 wwids, multiple sequential spaces in the middle of the value are replaced with a single underscore.

Spaces have been handled inconsistently in past releases.  In some cases, lvm would be able to use a device with the spaces, and in others it wouldn't.

In RHEL 9.0 and 9.1, lvm replaced leading and trailing spaces in sys_wwid and sys_serial with underscores, and was able to use the device.  So, we want to recognize and handle any system.devices entries with leading/trailing underscores.  These versions also replaced every middle space with an underscore, so we also want to recognize those (this bit of handling was already added in 9.2.)

In RHEL 9.2, wwids with leading spaces are not usable, and wwids with trailing spaces are usable only for the t10 type.  wwids with spaces in the middle of the wwid are only usable for the t10 type.  sys_serial is handled like 9.0 and 9.1, by replacing all spaces with underscores.

In practice, only t10 wwids and serial numbers are expected to contain spaces (naa and eui wwid standards do not permit spaces.)


Examples (quotes show spaces, and are not in the values):

reported sysfs wwid:     "  t10.123  456  "
expected system.devices: "t10.123_456"

reported sysfs wwid:      "  naa.123  456  "
expected system.devices:  "naa.123__456"

reported sysfs serial:    "  123  456  "
expected system.devices   "123__456"

Possible system.devices values created by previous lvm versions that we want to handle:

"__t10.123__456__"
"__naa.123__456__"
"__123__456__"


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 David Teigland 2023-06-15 20:27:35 UTC
in main branch:
https://sourceware.org/git/?p=lvm2.git;a=commit;h=228a8e8c1fd8e82a2e31a6060614dc3dd2f8bc51


$ mkdir -p /test/sys/dev/block/8:128/device/
$ lvmconfig | grep device_id_sysfs_dir
        device_id_sysfs_dir="/test/sys/"


$ rm /etc/lvm/devices/system.devices
$ echo "  t10.123  456  " > /test/sys/dev/block/8:128/device/wwid
$ lvmdevices --adddev /dev/sdi
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_wwid IDNAME=t10.123_456 DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m


$ rm /etc/lvm/devices/system.devices
$ echo "  naa.123  456  " > /test/sys/dev/block/8:128/device/wwid
$ lvmdevices --adddev /dev/sdi
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_wwid IDNAME=naa.123__456 DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m


$ rm /etc/lvm/devices/system.devices
$ rm /test/sys/dev/block/8:128/device/wwid
$ echo "  123  456  " > /test/sys/dev/block/8:128/device/serial
$ lvmdevices --adddev /dev/sdi
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_serial IDNAME=123__456 DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m

Comment 2 David Teigland 2023-06-16 14:37:01 UTC
Same device ids tested above, edited system.devices to add underscores that would have been added by previous lvm versions.


$ echo "  t10.123  456  " > /test/sys/dev/block/8:128/device/wwid
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_wwid IDNAME=__t10.123__456__ DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m


$ echo "  naa.123  456  " > /test/sys/dev/block/8:128/device/wwid
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_wwid IDNAME=__naa.123__456__ DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m


$ echo "  123  456  " > /test/sys/dev/block/8:128/device/serial
$ grep IDNAME /etc/lvm/devices/system.devices 
IDTYPE=sys_serial IDNAME=__123__456__ DEVNAME=/dev/sdi PVID=oBlXttXs30XwwvtWxcfWfh33YD944taH
$ pvs /dev/sdi
  PV         VG Fmt  Attr PSize PFree
  /dev/sdi      lvm2 ---  8.00m 8.00m

Comment 5 RHEL Program Management 2023-09-23 19:11:57 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 6 RHEL Program Management 2023-09-23 19:14:21 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.