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 1843454 - 2.9.0 regression: org.freedesktop.UDisks2.VolumeGroup.Delete does not clean up fstab mounts any more for deactivated LV
Summary: 2.9.0 regression: org.freedesktop.UDisks2.VolumeGroup.Delete does not clean u...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: udisks2
Version: 8.3
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.3
Assignee: Tomáš Bžatek
QA Contact: guazhang@redhat.com
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-06-03 10:49 UTC by Martin Pitt
Modified: 2021-09-06 15:33 UTC (History)
2 users (show)

Fixed In Version: udisks2-2.9.0-2.el8
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-11-04 03:33:54 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 RHEA-2020:4749 0 None None None 2020-11-04 03:34:02 UTC

Description Martin Pitt 2020-06-03 10:49:25 UTC
Description of problem: In the Cockpit unit tests we check [1] that udisks properly cleans up /etc/fstab and /etc/crypttab for volumes which have the track-parents option set. This does not work properly any more in recent RHEL 8.3 with udisks 2.9.0.


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

udisks2-2.9.0-1.el8.x86_64

How reproducible: Always


Steps to Reproduce:
1. Create a VG with an LV. Cockpit does the following D-Bus calls:

  ["/org/freedesktop/UDisks2/Manager","org.freedesktop.UDisks2.Manager.LVM2","VolumeGroupCreate",["TEST",["/org/freedesktop/UDisks2/block_devices/sda"],{}]]

  ["/org/freedesktop/UDisks2/lvm/TEST","org.freedesktop.UDisks2.VolumeGroup","CreatePlainVolume",["lvol",50331648,{}]]

That part should also work with plain CLI commands:

  modprobe scsi_debug dev_size_mb=50  # should create /dev/sda
  busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/Manager org.freedesktop.UDisks2.Manager EnableModules b true

  # create VG with the scsi-debug device:
  busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/Manager org.freedesktop.UDisks2.Manager.LVM2 VolumeGroupCreate 'saoa{sv}' TEST 1 /org/freedesktop/UDisks2/block_devices/sda 0

  # create LV
  busctl call org.freedesktop.UDisks2 /org/freedesktop/UDisks2/lvm/TEST org.freedesktop.UDisks2.VolumeGroup CreatePlainVolume 'sta{sv}' lvol 50000000 0


2. Create an encrypted (LUKS) ext4 file system, and assign a mount point "/run/mount1" in /etc/fstab. That's the D-Bus call:

  ["/org/freedesktop/UDisks2/block_devices/dm_2d2","org.freedesktop.UDisks2.Block","Format",["ext4",{"tear-down":{"t":"b","v":true},"label":{"t":"s","v":"FS"},"encrypt.passphrase":{"t":"s","v":"einszweidrei"},"config-items":{"t":"a(sa{sv})","v":[["crypttab",{"options":{"t":"ay","v":"bXktY3J5cHRvLXRhZwA="},"track-parents":{"t":"b","v":true},"passphrase-contents":{"t":"ay","v":"AA=="}}],["fstab",{"dir":{"t":"ay","v":"L3J1bi9tb3VudDEA"},"type":{"t":"ay","v":"YXV0bwA="},"opts":{"t":"ay","v":"bm9hdXRvAA=="},"freq":{"t":"i","v":0},"passno":{"t":"i","v":0},"track-parents":{"t":"b","v":true}}]]}}]]


Trying to cram that into a busctl call made my head explode. This can be done easily in Cockpit, and for a test case this will likely require a reproducer in Python or whatever your tests currently use :-)

3. Make things a little harder for udisks by locking the LUKS volume:

  ["/org/freedesktop/UDisks2/block_devices/dm_2d2","org.freedesktop.UDisks2.Encrypted","Lock",[{}]]

4. And even harder by deactivating the LV:

  ["/org/freedesktop/UDisks2/lvm/TEST/lvol","org.freedesktop.UDisks2.LogicalVolume","Deactivate",[{}]]

That is the crucial step -- without that, cleanup still works fine.

5. Delete the VG, with the tear-down option to clean up:

  ["/org/freedesktop/UDisks2/lvm/TEST","org.freedesktop.UDisks2.VolumeGroup","Delete",[true,{"tear-down":{"t":"b","v":true}}]]

Actual results: crypttab gets cleaned, but fstab still has the mount point, even though it has correct x-parents:

UUID=8756620a-81df-4a18-82ff-e8b944018cb0 /run/mount1 auto noauto,x-parent=869695f6-440a-4462-8a84-73fd6171af69,x-parent=2fOHyX-Cbez-M3L7-bvl1-li1O-VbzB-E1mWLg 0 0



Expected results: /run/mount1 mount point gets cleaned from fstab.


Additional info:

[1] https://github.com/cockpit-project/cockpit/blob/master/test/verify/check-storage-hidden#L95

Comment 2 Tomáš Bžatek 2020-06-10 11:44:09 UTC
(In reply to Martin Pitt from comment #0)
> Actual results: crypttab gets cleaned, but fstab still has the mount point,
> even though it has correct x-parents:

Confirming, wrote a test case that reproduces the problem. Thanks for this detailed repro steps! :-)

Comment 3 Tomáš Bžatek 2020-06-19 17:08:59 UTC
Found it, the following change broke matching by needle:

commit 9be5c4a6a4c206c726b5f08c8c9d9fd132805ae4
Author: Tomas Bzatek <tbzatek>
Date:   Wed Mar 11 18:26:25 2020 +0100

    udiskslinuxblock: Use libmount for fstab enumeration

Comment 6 Tomáš Bžatek 2020-06-23 15:56:40 UTC
Upstream pull request: https://github.com/storaged-project/udisks/pull/782

Comment 7 Tomáš Bžatek 2020-06-23 15:57:07 UTC
More work needed upstream: https://github.com/storaged-project/udisks/issues/781

Comment 8 guazhang@redhat.com 2020-07-08 11:44:16 UTC
Hello

I don't see the PR 782 patch in udisks projeck.

Comment 9 Tomáš Bžatek 2020-07-08 12:19:42 UTC
(In reply to guazhang from comment #8)
> Hello
> 
> I don't see the PR 782 patch in udisks projeck.

What do you mean? The #782 is still on review upstream. The single interested commit is udisks-2.9.1-teardown-needle-match.patch as packaged in the udisks2-2.9.0-2.el8 rpm.

Comment 10 guazhang@redhat.com 2020-07-09 07:40:01 UTC
Hello

test pass with cockpit regression testing check-storage-hidden script and the /etc/fstab /etc/crypttab were cleaned. so move to verified.

Comment 13 errata-xmlrpc 2020-11-04 03:33:54 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 (udisks2 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/RHEA-2020:4749


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