Bug 2119473
| Summary: | lvm crashes during recreation of a PV with a uuid of a missing PV | |||
|---|---|---|---|---|
| Product: | Red Hat Enterprise Linux 9 | Reporter: | Lukáš Zaoral <lzaoral> | |
| Component: | lvm2 | Assignee: | David Teigland <teigland> | |
| lvm2 sub component: | Command-line tools | QA Contact: | cluster-qe <cluster-qe> | |
| Status: | CLOSED ERRATA | Docs Contact: | ||
| Severity: | unspecified | |||
| Priority: | unspecified | CC: | agk, cmarthal, heinzm, jbrassow, msnitzer, pcahyna, prajnoha, teigland, thornber, zkabelac | |
| Version: | 9.0 | Keywords: | Triaged | |
| Target Milestone: | rc | Flags: | pm-rhel:
mirror+
|
|
| Target Release: | --- | |||
| Hardware: | Unspecified | |||
| OS: | Unspecified | |||
| Whiteboard: | ||||
| Fixed In Version: | lvm2-2.03.17-1.el9 | Doc Type: | If docs needed, set a value | |
| Doc Text: | Story Points: | --- | ||
| Clone Of: | ||||
| : | 2121237 (view as bug list) | Environment: | ||
| Last Closed: | 2023-05-09 08:23:45 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: | ||||
| Bug Depends On: | ||||
| Bug Blocks: | 2117937, 2121237 | |||
|
Description
Lukáš Zaoral
2022-08-18 15:49:01 UTC
fixed on main branch https://sourceware.org/git/?p=lvm2.git;a=commit;h=8c3cfc75c72696ae8b620555fcc4f815b0c1d6b6 Note that the test above requires the device to use IDTYPE=devname which causes the IDNAME to be cleared in the devices file when it becomes invalid. The blank IDNAME field is what reveals the bug. I used /dev/ram0 (which uses IDNAME=devname) to reproduced and verify. Adding QA ack for 9.2 SCENARIO - recreation_of_brd_pv_using_uuid_after_device_goes_missing: Ensure lvm can recreate a brd PV, which uses IDNAME=devname, using uuid once the device is wiped (bug 2119473) Loading block ram disk module adding entry to the devices file for /dev/ram6 creating PV on hayes-01 using device /dev/ram6 pvcreate --yes -ff /dev/ram6 Physical volume "/dev/ram6" successfully created. PV uuid for /dev/ram6: UnPPU9M2CpjZFovviKRkBJ9NsnQvsw8G Wiping brd header (wipefs -fa /dev/ram6) /dev/ram6: 8 bytes were erased at offset 0x00000218 (LVM2_member): 4c 56 4d 32 20 30 30 31 pvcreate -ff --yes -v --uuid UnPPU9M2CpjZFovviKRkBJ9NsnQvsw8G --norestorefile /dev/ram6 Devices file PVID UnPPU9M2CpjZFovviKRkBJ9NsnQvsw8G not found on device /dev/ram6. Wiping signatures on new PV /dev/ram6. WARNING: adding device /dev/ram6 with PVID UnPPU9M2CpjZFovviKRkBJ9NsnQvsw8G which is already used for missing device. pv-recreation failed with a valid uuid and wiped header (bug 2119473) Aug 24 16:18:02 hayes-01 kernel: pvcreate[157676]: segfault at 0 ip 00007fb45bdb8192 sp 00007ffe16f5ff48 error 4 in libc-2.28.so[7fb45bcf0000+1bc000] Aug 24 16:18:02 hayes-01 kernel: Code: 0f 1f 84 00 00 00 00 00 f3 0f 1e fa 89 f8 31 d2 c5 c5 ef ff 09 f0 25 ff 0f 00 00 3d 80 0f 00 00 0f 8f 52 03 00 00 c5 fe 6f 0f <c5> f5 74 06 c5f (In reply to David Teigland from comment #1) > Note that the test above requires the device to use IDTYPE=devname which > causes the IDNAME to be cleared in the devices file when it becomes invalid. > The blank IDNAME field is what reveals the bug. I used /dev/ram0 (which > uses IDNAME=devname) to reproduced and verify. Indeed. The bug originally happened on a PowerVM LPAR, where the virtual SCSI disks are using IDTYPE=devname: # LVM uses devices listed in this file. # Created by LVM command vgchange pid 637 at Fri Aug 26 12:22:22 2022 VERSION=1.1.5 IDTYPE=devname IDNAME=/dev/sda3 DEVNAME=/dev/sda3 PVID=r9h2EoNfx5FhWY7D4OWxrSU54xu0TkM1 PART=3 IDTYPE=devname IDNAME=/dev/sdc1 DEVNAME=/dev/sdc1 PVID=aWqxcHZzJ70D3rmEQI3b7ch9LkTGHYFw PART=1 probably because the devices don't have any ID: # sg_vpd --page=di /dev/sda fetching VPD page failed: Numerical argument out of domain sg_vpd failed: Numerical argument out of domain # sg_inq -e /dev/sda VPD INQUIRY, page code=0x00: Supported VPD pages: 0x0 Supported VPD pages 0x80 Unit serial number 0xb1 Block device characteristics (sbc3) 0xfa This could be a problem anyway, because in RHEL 9 the /sev/sd* device names started being assigned very unpredictably. Would it be possible to identify disks by their serial number if there is no WWID? These disks have a serial number: # sg_vpd --page=0x80 /dev/sda Unit serial number VPD page: Unit serial number: 00fac60100004c000000017bead7ca41.72 and it can be seen under /dev/disk/by-id # ls -l /dev/disk/by-id lrwxrwxrwx. 1 root root 9 Aug 26 12:22 scsi-SAIX_VDASD_00fac60100004c000000017bead7ca41.72 -> ../../sda lrwxrwxrwx. 1 root root 9 Aug 26 12:22 scsi-SAIX_VDASD_00fac60100004c000000017bead7ca41.73 -> ../../sdb lrwxrwxrwx. 1 root root 9 Aug 26 12:22 scsi-SAIX_VDASD_00fac60100004c000000017bead7ca41.74 -> ../../sdc lrwxrwxrwx. 1 root root 9 Aug 26 12:22 scsi-SAIX_VDASD_00fac60100004c000000017bead7ca41.75 -> ../../sdd (In reply to Pavel Cahyna from comment #3) > This could be a problem anyway, because in RHEL 9 the /sev/sd* device names > started being assigned very unpredictably. Would it be possible to identify > disks by their serial number if there is no WWID? These disks have a serial > number: > > # sg_vpd --page=0x80 /dev/sda > Unit serial number VPD page: > Unit serial number: 00fac60100004c000000017bead7ca41.72 Yes, and lvm does already attempt to use a serial number by reading /sys/dev/block/major:minor/device/serial. But, it looks like that sysfs file is not populated with the serial number that sg_vpd found. Could you check that the /sys/.../serial value is indeed missing or empty for this device? Also could you check if /sys/dev/block/major:minor/device/vpd_pg80 (or vpd_pg83) files exist? In RHEL9.1 lvm will begin using vpd_pg83 to get wwids, and it's possible that we could use the vpd_pg80 sysfs file to get a serial number if it's reported there. There is no /sys/dev/block/major:minor/device/serial (nor vpd_pg83, but I think that this is expected, since the disk does not support page 0x83). There is vpd_pg80, it has binary content: # od -a /sys/dev/block/8:16/device/vpd_pg80 0000000 nul nul nul $ 0 0 f a c 6 0 1 0 0 0 0 0000020 4 c 0 0 0 0 0 0 0 1 7 b e a d 7 0000040 c a 4 1 . 2 4 nul 0000050 (it is not the same system as I used before, so the serial numbers will differ. The content corresponds somehow to what sg_vpd reports: # sg_vpd --page=0x80 /dev/sdb Unit serial number VPD page: Unit serial number: 00fac60100004c000000017bead7ca41.24 with the exception of the NUL and $ characters.) There is also a wwid file, but reading it returns ENXIO. (This is for /dev/sdb, but the actual PV is on /dev/sdb3, which does not have /sys/dev/block/major:minor/device .) kernel is 5.14.0-162.6.1.el9_1.ppc64le, lvm2 is lvm2-2.03.16-3.el9.ppc64le. (In reply to David Teigland from comment #4) > In RHEL9.1 lvm will begin using vpd_pg83 to get > wwids, and it's possible that we could use the vpd_pg80 sysfs file to get a > serial number if it's reported there. Should I open a separate RFE for that issue? (In reply to Pavel Cahyna from comment #6) > (In reply to David Teigland from comment #4) > > > In RHEL9.1 lvm will begin using vpd_pg83 to get > > wwids, and it's possible that we could use the vpd_pg80 sysfs file to get a > > serial number if it's reported there. > > Should I open a separate RFE for that issue? yes that would be helpful > > wwids, and it's possible that we could use the vpd_pg80 sysfs file to get a > > serial number if it's reported there. > > Should I open a separate RFE for that issue? I ran into this same issue elsewhere and created bug 2136906 Marking Verified:Tested in the latest rpms. kernel-5.14.0-176.el9 BUILT: Wed Oct 12 03:57:18 AM CDT 2022 lvm2-2.03.17-1.el9 BUILT: Thu Nov 10 10:02:16 AM CST 2022 lvm2-libs-2.03.17-1.el9 BUILT: Thu Nov 10 10:02:16 AM CST 2022 SCENARIO - recreation_of_brd_pv_using_uuid_after_device_goes_missing: Ensure lvm can recreate a brd PV, which uses IDNAME=devname, using uuid once the device is wiped (bug 2119473|2121237) Loading block ram disk module adding entry to the devices file for /dev/ram6 creating PV on hayes-03 using device /dev/ram6 pvcreate --yes -ff /dev/ram6 Physical volume "/dev/ram6" successfully created. PV uuid for /dev/ram6: n3FWpCz2jrYT2cIZx5ye4grIr6zC4aN1 Wiping brd header (wipefs -fa /dev/ram6) /dev/ram6: 8 bytes were erased at offset 0x00000218 (LVM2_member): 4c 56 4d 32 20 30 30 31 pvcreate -ff --yes -v --uuid n3FWpCz2jrYT2cIZx5ye4grIr6zC4aN1 --norestorefile /dev/ram6 Physical volume "/dev/ram6" successfully created. Devices file PVID n3FWpCz2jrYT2cIZx5ye4grIr6zC4aN1 not found on device /dev/ram6. Wiping signatures on new PV /dev/ram6. WARNING: adding device /dev/ram6 with PVID n3FWpCz2jrYT2cIZx5ye4grIr6zC4aN1 which is already used for missing device device_id none. Set up physical volume for "/dev/ram6" with 32768 available sectors. Zeroing start of device /dev/ram6. Writing physical volume data to disk "/dev/ram6". Checking for segfault notification (bug 2119473|2121237) Re-scanning lvm PVs (pvscan --cache) pvscan[61821] PV /dev/ram6 not used. removing pv /dev/ram6 on hayes-03 Labels on physical volume "/dev/ram6" successfully wiped. removing entry from the devices file for /dev/ram6 Unloading block ram disk module Marking VERIFIED in the latest build as well. kernel-5.14.0-229.el9 BUILT: Thu Jan 5 05:38:37 PM CET 2023 lvm2-2.03.17-4.el9 BUILT: Tue Jan 10 06:40:12 PM CET 2023 lvm2-libs-2.03.17-4.el9 BUILT: Tue Jan 10 06:40:12 PM CET 2023 SCENARIO - recreation_of_brd_pv_using_uuid_after_device_goes_missing: Ensure lvm can recreate a brd PV, which uses IDNAME=devname, using uuid once the device is wiped (bug 2119473|2121237) Loading block ram disk module adding entry to the devices file for /dev/ram6 creating PV on virt-540.cluster-qe.lab.eng.brq.redhat.com using device /dev/ram6 pvcreate --yes -ff /dev/ram6 Physical volume "/dev/ram6" successfully created. PV uuid for /dev/ram6: HBQVUslCL6vP2OIdTtDtUOvFaHrH4ZDi Wiping brd header (wipefs -fa /dev/ram6) /dev/ram6: 8 bytes were erased at offset 0x00000218 (LVM2_member): 4c 56 4d 32 20 30 30 31 pvcreate -ff --yes -v --uuid HBQVUslCL6vP2OIdTtDtUOvFaHrH4ZDi --norestorefile /dev/ram6 Physical volume "/dev/ram6" successfully created. Devices file PVID HBQVUslCL6vP2OIdTtDtUOvFaHrH4ZDi not found on device /dev/ram6. Wiping signatures on new PV /dev/ram6. WARNING: adding device /dev/ram6 with PVID HBQVUslCL6vP2OIdTtDtUOvFaHrH4ZDi which is already used for missing device device_id none. Set up physical volume for "/dev/ram6" with 32768 available sectors. Zeroing start of device /dev/ram6. Writing physical volume data to disk "/dev/ram6". Checking for segfault notification (bug 2119473|2121237) Re-scanning lvm PVs (pvscan --cache) pvscan[40948] PV /dev/ram6 not used. removing pv /dev/ram6 on virt-540.cluster-qe.lab.eng.brq.redhat.com Labels on physical volume "/dev/ram6" successfully wiped. removing entry from the devices file for /dev/ram6 Unloading block ram disk module Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory (lvm2 bug fix and enhancement update), and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2023:2544 |