A reused mount point is removed after deactivating the original volume group

Bug #2100252 reported by Chengen Du
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
systemd (Ubuntu)
Fix Released
Undecided
Unassigned
Focal
Won't Fix
Undecided
Chengen Du
Jammy
Fix Released
Undecided
dongdong tao
Noble
Fix Released
Undecided
Unassigned
Oracular
Fix Released
Undecided
Unassigned
Plucky
Fix Released
Undecided
Unassigned

Bug Description

[Impact]
A mount point was originally used by the old volume group.
After replacing it with a new volume group and deactivating the old one, the mount point, now belonging to the new volume group, gets unmounted accidentally.

[Fix]
A patch set has been introduced to fix this issue:
https://github.com/systemd/systemd/pull/23508

The related patches are as follows:
367a2597c351 core/device: store the original path
dce2d35ce53d core/device: move several functions
4a1a1caf2192 core/device: always accept syspath change

[Test Plan]
1. Set up a virtual machine with two volume groups: vg1 and vg2.
root@lvm-focal:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 91.9M 1 loop /snap/lxd/24061
loop1 7:1 0 49.9M 1 loop /snap/snapd/18357
loop2 7:2 0 63.3M 1 loop /snap/core20/1828
loop3 7:3 0 44.4M 1 loop /snap/snapd/23545
loop4 7:4 0 63.8M 1 loop /snap/core20/2496
loop5 7:5 0 91.9M 1 loop /snap/lxd/29619
sr0 11:0 1 1024M 0 rom
vda 252:0 0 500G 0 disk
├─vda1 252:1 0 1M 0 part
├─vda2 252:2 0 2G 0 part /boot
└─vda3 252:3 0 498G 0 part
  └─ubuntu--vg-ubuntu--lv 253:2 0 100G 0 lvm /
vdb 252:16 0 20G 0 disk
├─vdb1 252:17 0 9.5G 0 part
│ └─vg1-lvol0 253:0 0 2G 0 lvm
└─vdb2 252:18 0 10.5G 0 part
  └─vg2-lvol0 253:1 0 2G 0 lvmt

2. Add a mount point entry in /etc/fstab.
/dev/mapper/vg1-lvol0 /mnt/xfs xfs defaults 0 0

3. Run `mount -av` to mount the specified mount point.

4. Unmount the mount point and rename the volume groups.
umount /mnt/xfs
vgrename vg1 vg1_old
vgrename vg2 vg1;

5. Run `mount -av` again and verify that the mount point is successfully mounted.
root@lvm-focal:~# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 91.9M 1 loop /snap/lxd/24061
loop1 7:1 0 49.9M 1 loop /snap/snapd/18357
loop2 7:2 0 63.3M 1 loop /snap/core20/1828
loop3 7:3 0 44.4M 1 loop /snap/snapd/23545
loop4 7:4 0 63.8M 1 loop /snap/core20/2496
loop5 7:5 0 91.9M 1 loop /snap/lxd/29619
sr0 11:0 1 1024M 0 rom
vda 252:0 0 500G 0 disk
├─vda1 252:1 0 1M 0 part
├─vda2 252:2 0 2G 0 part /boot
└─vda3 252:3 0 498G 0 part
  └─ubuntu--vg-ubuntu--lv 253:2 0 100G 0 lvm /
vdb 252:16 0 20G 0 disk
├─vdb1 252:17 0 9.5G 0 part
└─vdb2 252:18 0 10.5G 0 part
  └─vg1-lvol0 253:1 0 2G 0 lvm /mnt/xfs

6. Deactivate the old volume group and ensure that the mount point remains available.
vgchange -an vg1_old

[Where problems could occur]
This patch set modifies the handling of devlink.
If any regressions occur, the device unit may become non-functional.

Related branches

Revision history for this message
Chengen Du (chengendu) wrote :

The patched fix has already been included in Noble, Oracular, and Plucky.

Changed in systemd (Ubuntu Plucky):
status: New → Won't Fix
Changed in systemd (Ubuntu Oracular):
status: New → Won't Fix
Changed in systemd (Ubuntu Noble):
status: New → Won't Fix
Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Focal

Revision history for this message
Chengen Du (chengendu) wrote :

Debdiff for Jammy

Changed in systemd (Ubuntu Focal):
status: New → In Progress
Changed in systemd (Ubuntu Jammy):
status: New → In Progress
Changed in systemd (Ubuntu Focal):
assignee: nobody → Chengen Du (chengendu)
Changed in systemd (Ubuntu Jammy):
assignee: nobody → Chengen Du (chengendu)
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "lp2100252-systemd-focal.debdiff" seems to be a debdiff. The ubuntu-sponsors team has been subscribed to the bug report so that they can review and hopefully sponsor the debdiff. If the attachment isn't a patch, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are member of the ~ubuntu-sponsors, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issue please contact him.]

tags: added: patch
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Thank you for the patches. There is already a systemd SRU in process for jammy, but I will add this to my queue to consider for the next one.

tags: added: systemd-sru-next
Changed in systemd (Ubuntu):
status: New → Invalid
Revision history for this message
Heitor Alves de Siqueira (halves) wrote :

The fix commit [0] was introduced in systemd v252, so it's already fixed starting with Noble.

[0] https://github.com/systemd/systemd/commit/c75efa3f7e34eb593e2a6df1313ba8fdcbe729c1

Changed in systemd (Ubuntu):
status: Invalid → Fix Released
Changed in systemd (Ubuntu Oracular):
status: Won't Fix → Fix Released
Changed in systemd (Ubuntu Noble):
status: Won't Fix → Fix Released
Changed in systemd (Ubuntu Plucky):
status: Won't Fix → Fix Released
Revision history for this message
Nick Rosbrook (enr0n) wrote :

Hi Chengen,

Below is my initial review of the patches. I think there is a lot that can be done here to simplify and reduce noise, so that only the critical logic changes are included.

> lp2100252-0001-sd-device-introduce-sd_device_new_from_devname.patch

1. The sd_device_new_from_path() function is never use. Please drop that change.
2. Let's not add sd_device_new_from_devname() to the public API here. While that is the upstream change, I would like to avoid adding symbols to libsystemd in this SRU. Instead, please move the function to src/libsystemd/sd-device/device-private.c, and call it device_new_from_devname() or so.

> lp2100252-0002-core-device-store-the-original-path.patch

I think this patch is fine as-is. It's a preparation commit, and is required for the real changes later.

> lp2100252-0003-core-device-move-several-functions.patch

This patch appears to just move code around. Is this needed at all? If it is needed to compile correctly, can this instead be accomplished with forward declarations? That would be a far less noisy patch.

> lp2100252-0004-core-device-always-accept-syspath-change.patch

This seems reasonable from a first glance, but I will take a closer look on a later review.

Also, it's up to you, but note that we do manage the systemd packaging in git at https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/systemd. It may be more convenient for review purposes to open PRs, rather than using debdiffs.

Changed in systemd (Ubuntu Focal):
status: In Progress → Incomplete
Changed in systemd (Ubuntu Jammy):
status: In Progress → Incomplete
Revision history for this message
Chengen Du (chengendu) wrote :

Hi Nick, I’ve followed your suggestions and submitted the PRs. Please take a look when you have a chance. Thanks!

Changed in systemd (Ubuntu Focal):
status: Incomplete → Triaged
Changed in systemd (Ubuntu Jammy):
status: Incomplete → Triaged
Revision history for this message
Chengen Du (chengendu) wrote :

Focal will not be fixed as it has reached the end of standard support.

Changed in systemd (Ubuntu Focal):
status: Triaged → Won't Fix
dongdong tao (taodd)
Changed in systemd (Ubuntu Jammy):
assignee: Chengen Du (chengendu) → dongdong tao (taodd)
Revision history for this message
Julian Andres Klode (juliank) wrote : Please test proposed package

Hello Chengen, or anyone else affected,

Accepted systemd into jammy-proposed. The package will build now and be available at https://launchpad.net/ubuntu/+source/systemd/249.11-0ubuntu3.17 in a few hours, and then in the -proposed repository.

Please help us by testing this new package. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation on how to enable and use -proposed. Your feedback will aid us getting this update out to other Ubuntu users.

If this package fixes the bug for you, please add a comment to this bug, mentioning the version of the package you tested, what testing has been performed on the package and change the tag from verification-needed-jammy to verification-done-jammy. If it does not fix the bug for you, please add a comment stating that, and change the tag to verification-failed-jammy. In either case, without details of your testing we will not be able to proceed.

Further information regarding the verification process can be found at https://wiki.ubuntu.com/QATeam/PerformingSRUVerification . Thank you in advance for helping!

N.B. The updated package will be released to -updates after the bug(s) fixed by this package have been verified and the package has been in -proposed for a minimum of 7 days.

Changed in systemd (Ubuntu Jammy):
status: Triaged → Fix Committed
tags: added: verification-needed verification-needed-jammy
Revision history for this message
Ubuntu SRU Bot (ubuntu-sru-bot) wrote : Autopkgtest regression report (systemd/249.11-0ubuntu3.17)

All autopkgtests for the newly accepted systemd (249.11-0ubuntu3.17) for jammy have finished running.
The following regressions have been reported in tests triggered by the package:

casync/2+20201210-1build1 (arm64)
docker.io-app/27.5.1-0ubuntu3~22.04.2 (amd64, ppc64el, s390x)
exim4/4.95-4ubuntu2.6 (ppc64el)
initramfs-tools/0.140ubuntu13.5 (arm64)
linux-gcp-6.8/6.8.0-1037.39~22.04.1 (arm64)
linux-gke/5.15.0-1088.94 (amd64)
linux-hwe-6.5/6.5.0-45.45~22.04.1 (amd64, arm64)
linux-hwe-6.8/6.8.0-79.79~22.04.1 (arm64)
linux-lowlatency/5.15.0-156.166 (amd64)
linux-lowlatency/unknown (arm64)
linux-lowlatency-hwe-6.5/6.5.0-45.45.1~22.04.1 (arm64)
linux-nvidia-6.5/unknown (arm64)
mosquitto/2.0.11-1ubuntu1.2 (ppc64el)
munin/2.0.57-1ubuntu2 (armhf)
sks/1.1.6+git20210302.c3ba6d5a-4 (amd64, arm64, ppc64el)

Please visit the excuses page listed below and investigate the failures, proceeding afterwards as per the StableReleaseUpdates policy regarding autopkgtest regressions [1].

https://people.canonical.com/~ubuntu-archive/proposed-migration/jammy/update_excuses.html#systemd

[1] https://wiki.ubuntu.com/StableReleaseUpdates#Autopkgtest_Regressions

Thank you!

Revision history for this message
Athos Ribeiro (athos) wrote (last edit ):

For docker.io-app, please see LP: #2124109. This is a regression due to the debian-archive-keyring package being outdated in jammy. I am currently working on this one. I did get a local run with the fix (available at https://launchpad.net/~athos-ribeiro/+archive/ubuntu/container-stack-qq/+packages) to pass locally using the jammy-proposed pocket, which includes this SRU. Therefore, for this SRU purposes, this should be safe to ignore (throrugh a hint) since it is an unrelated regression in docker.io-app/debian-archive-keyring.

Revision history for this message
dongdong tao (taodd) wrote :

Hello,

I've verified the proposed package 249.11-0ubuntu3.17, and confirm it fixes the issue.
The test I've done:
1. Set up a jammy vm with two volume groups: vg1 and vg2.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
loop0 7:0 0 89.4M 1 loop /snap/lxd/31333
loop1 7:1 0 49.3M 1 loop /snap/snapd/24792
loop2 7:2 0 63.8M 1 loop /snap/core20/2599
loop3 7:3 0 50.8M 1 loop /snap/snapd/25202
vda 252:0 0 20G 0 disk
├─vda1 252:1 0 19.9G 0 part /
├─vda14 252:14 0 4M 0 part
└─vda15 252:15 0 106M 0 part /boot/efi
vdb 252:16 0 20G 0 disk
├─vdb1 252:17 0 10G 0 part
│ └─vg1-lvol0 253:0 0 5G 0 lvm
└─vdb2 252:18 0 10G 0 part
  └─vg2-lvol0 253:1 0 5G 0 lvm

2. Add a mount point entry in /etc/fstab.
/dev/mapper/vg1-lvol0 /mnt/xfs xfs defaults 0 0

3. Run `mount -av` to mount the specified mount point.

4. Unmount the mount point and rename the volume groups.
umount /mnt/xfs
vgrename vg1 vg1_old
vgrename vg2 vg1;

5. Run `mount -av` again and verify that the mount point is successfully mounted.
/home/ubuntu# systemctl status mnt-xfs.mount
Warning: The unit file, source configuration file or drop-ins of mnt-xfs.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
● mnt-xfs.mount - /mnt/xfs
     Loaded: loaded (/etc/fstab; generated)
     Active: active (mounted) since Thu 2025-09-25 01:14:27 UTC; 5s ago
      Where: /mnt/xfs
       What: /dev/mapper/vg1-lvol0
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
        CPU: 2ms

6. Deactivate the old volume group and ensure that the mount point remains available.
# vgchange -an vg1_old
  0 logical volume(s) in volume group "vg1_old" now active
root@juju-59e4a8-ceph-quincy-12:/home/ubuntu# systemctl status mnt-xfs.mount
Warning: The unit file, source configuration file or drop-ins of mnt-xfs.mount changed on disk. Run 'systemctl daemon-reload' to reload units.
● mnt-xfs.mount - /mnt/xfs
     Loaded: loaded (/etc/fstab; generated)
     Active: active (mounted) since Thu 2025-09-25 01:14:27 UTC; 17s ago
      Where: /mnt/xfs
       What: /dev/mapper/vg1-lvol0
       Docs: man:fstab(5)
             man:systemd-fstab-generator(8)
        CPU: 2ms

tags: added: verification-done-jammy
removed: verification-needed-jammy
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package systemd - 249.11-0ubuntu3.17

---------------
systemd (249.11-0ubuntu3.17) jammy; urgency=medium

  [ Nick Rosbrook ]
  * initramfs-tools: copy hwdb.bin to initramfs (LP: #2112237)
  * d/t/tests-in-lxd: drop patching workaround (LP: #2115263)
    - d/t/control: add Depends: dnsmasq-base
      (Revealed by test progressing past previous failure)

  [ Chengen Du ]
  * core/device: fix devlink handling (LP: #2100252)

 -- Nick Rosbrook <email address hidden> Tue, 26 Aug 2025 11:23:06 -0400

Changed in systemd (Ubuntu Jammy):
status: Fix Committed → Fix Released
Revision history for this message
Nick Rosbrook (enr0n) wrote : Update Released

The verification of the Stable Release Update for systemd has completed successfully and the package is now being released to -updates. Subsequently, the Ubuntu Stable Release Updates Team is being unsubscribed and will not receive messages about this bug report. In the event that you encounter a regression using the package from -updates please report a new bug using ubuntu-bug and tag the bug report regression-update so we can easily find any regressions.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.