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 1868169 - lvcreate behavior change when detected signature is found
Summary: lvcreate behavior change when detected signature is found
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: lvm2
Version: 8.3
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: 8.0
Assignee: Marian Csontos
QA Contact: cluster-qe@redhat.com
URL:
Whiteboard:
Depends On:
Blocks: 1894692
TreeView+ depends on / blocked
 
Reported: 2020-08-11 21:33 UTC by Corey Marthaler
Modified: 2021-09-07 11:54 UTC (History)
9 users (show)

Fixed In Version: lvm2-2.03.09-5.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1894692 (view as bug list)
Environment:
Last Closed: 2020-11-04 02:00:38 UTC
Type: Bug
Target Upstream Version:
Embargoed:
pm-rhel: mirror+


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2020:4546 0 None None None 2020-11-04 02:00:51 UTC

Description Corey Marthaler 2020-08-11 21:33:38 UTC
Description of problem:

QA's regression tests attempt to always use "--yes" in case of prompts when doing remote create commands where old signatures might (and likely do) exist. However prior to the last build, LVM just created the volume anyways and existed with a 0 return code. Same with interrupted commands. 

Now LVM continues to create the volumes, but exists non zero causing many of our tests to fail for simple signature checks and reports "Unable to deactivate failed new LV test/lvol0. Manual intervention required." making it seem like a pretty big deal.

Regardless of whether or not this is the new expected behavior, I'm not sure introducing this in the middle of a release like this is the best time, and certainly there should have been QA buy-in for this in an RFE bug somewhere. 


# New 8.3 rpms
lvm2-2.03.09-4.el8    BUILT: Sun Aug  9 14:55:08 CDT 2020
lvm2-libs-2.03.09-4.el8    BUILT: Sun Aug  9 14:55:08 CDT 2020

# remote attempt

[cmarthal@localhost bin]$ qarsh root@hayes-02  lvcreate -L 100M test
WARNING: ext4 signature detected on /dev/test/lvol0 at offset 1080. Wipe it? [y/n]: [n]
  Aborted wiping of ext4.
  1 existing signature left on the device.
  Filed to wipe signatures of logical volume test/lvol0.
  Aborting. Failed to wipe start of new LV.
  Logical volume test/lvol0 in use.
  Unable to deactivate failed new LV test/lvol0. Manual intervention required.

# aborted attempt

[root@hayes-02 bin]# lvcreate -L 100M test
WARNING: ext4 signature detected on /dev/test/lvol0 at offset 1080. Wipe it? [y/n]: ^C  Interrupted...
  Aborted wiping of ext4.
  1 existing signature left on the device.
  Filed to wipe signatures of logical volume test/lvol0.
  Aborting. Failed to wipe start of new LV.
  Logical volume test/lvol0 in use.
  Unable to deactivate failed new LV test/lvol0. Manual intervention required.
[root@hayes-02 bin]# lvs
  LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvol0 test -wi-a----- 100.00m                                                    


# Prior 8.3 rpms
lvm2-2.03.09-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020
lvm2-libs-2.03.09-3.el8    BUILT: Mon Jun 29 13:50:23 CDT 2020

# remote attempt

[cmarthal@localhost bin]$ qarsh root@hayes-02  lvcreate -L 100M test
WARNING: ext4 signature detected on /dev/test/lvol0 at offset 1080. Wipe it? [y/n]: [n]
  Aborted wiping of ext4.
  1 existing signature left on the device.
  Logical volume "lvol0" created.
[cmarthal@localhost bin]$ echo $?
0

# aborted attempt

[root@hayes-02 bin]# lvcreate -L 100M test
WARNING: ext4 signature detected on /dev/test/lvol0 at offset 1080. Wipe it? [y/n]: ^C  Interrupted...
  Aborted wiping of ext4.
  1 existing signature left on the device.
  Logical volume "lvol0" created.
[root@hayes-02 bin]# echo $?
0
[root@hayes-02 bin]# lvs
  LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert
  lvol0 test -wi-a----- 100.00m

Comment 2 Zdenek Kabelac 2020-08-12 09:14:02 UTC
Looks like an error path is not 'waiting' for  udev and collides on removal path and fails in abort path...

Otherwise it needs to be seen as 'bugfix' - since interruption of wiping shall not result in 'created' lvol0 as seen with older lvm2.

I'll take a look how to avoid 'abort' path to be excercised.

But it will result in  LV not being created.

If user wants to 'preserve' content on created LV he needs to pass  lvcreate -Zn -Wn

Comment 7 Corey Marthaler 2020-08-13 18:01:38 UTC
I assume this was added to lvm.conf as a result as this new behavior?

[root@hayes-01 ~]#  grep zero_metadata /etc/lvm/lvm.conf 
        # Configuration option allocation/zero_metadata.
        zero_metadata = 1

The latest build doesn't know about this option now so I'm assuming this needs to be pulled out of the config file as well.

[root@hayes-01 ~]# lvs
  Configuration setting "allocation/zero_metadata" unknown.



kernel-4.18.0-232.el8    BUILT: Mon Aug 10 02:17:54 CDT 2020
lvm2-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
lvm2-libs-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020

Comment 8 Corey Marthaler 2020-08-13 18:07:50 UTC
Actually, it looks like this was removed in the latest build, however the lvm.conf.rpmnew didn't over write the old file at install time.

Comment 9 Corey Marthaler 2020-08-13 19:37:16 UTC
Fix verified in the latest rpms.

kernel-4.18.0-232.el8    BUILT: Mon Aug 10 02:17:54 CDT 2020
lvm2-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
lvm2-libs-2.03.09-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020
device-mapper-event-libs-1.02.171-5.el8    BUILT: Wed Aug 12 15:51:50 CDT 2020


[root@hayes-01 ~]# lvcreate -L 100M test
WARNING: ext4 signature detected on /dev/test/lvol0 at offset 1080. Wipe it? [y/n]: ^C  Interrupted...
  Aborted wiping of ext4.
  1 existing signature left on the device.
  Logical volume "lvol0" created.
[root@hayes-01 ~]# lvs -a -o +devices
  LV    VG   Attr       LSize   Pool Origin Data%  Meta%  Move Log Cpy%Sync Convert Devices     
  lvol0 test -wi-a----- 100.00m                                                     /dev/sdb1(0)

Comment 10 Zdenek Kabelac 2020-09-14 10:52:33 UTC
Just for completeness the reported issue has been fixed upstream, so the abort is not being reported with 
version 2.03.11 with this patch:

https://www.redhat.com/archives/lvm-devel/2020-August/msg00015.html

Comment 13 errata-xmlrpc 2020-11-04 02:00:38 UTC
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-2020:4546


Note You need to log in before you can comment on or make changes to this bug.