diff --git a/0023-udev-create-symlinks-and-watch-even-in-suspended-sta.patch b/0023-udev-create-symlinks-and-watch-even-in-suspended-sta.patch new file mode 100644 index 0000000000000000000000000000000000000000..8ff2ac328bbf38c328c3211ea9a8a831e1081f71 --- /dev/null +++ b/0023-udev-create-symlinks-and-watch-even-in-suspended-sta.patch @@ -0,0 +1,43 @@ +From 0ffad44e2b768a09be410b7d0decceb6404c46d1 Mon Sep 17 00:00:00 2001 +From: Martin Wilck +Date: Fri, 28 Jan 2022 14:42:29 +0100 +Subject: [PATCH 1/2] udev: create symlinks and watch even in suspended state + +If a dm device is suspended, we can't run blkid on it. But earlier +rules (e.g. 11-dm-parts.rules) might have imported previously scanned +properties from the udev db, in particular if the device had been correctly +set up beforehand (DM_UDEV_PRIMARY_SOURCE_FLAG==1). Symlinks for existing +ID_FS_xyz properties must be preserved in this case. Otherwise lower-priority +devices (such as multipath components) might take over the symlink +temporarily. + +Likewise, we should't stop watching a temporarily suspended, but previously +correctly configured dm device. + +Signed-off-by: Martin Wilck +--- + udev/13-dm-disk.rules.in | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in +index fcb2f37..18254b4 100644 +--- a/udev/13-dm-disk.rules.in ++++ b/udev/13-dm-disk.rules.in +@@ -17,10 +17,14 @@ ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end" + ENV{DM_NAME}=="?*", SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" + ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" + ++ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_link" ++ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_link" + ENV{DM_SUSPENDED}=="1", GOTO="dm_end" + ENV{DM_NOSCAN}=="1", GOTO="dm_watch" + + (BLKID_RULE) ++ ++LABEL="dm_link" + ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" + ENV{ID_FS_USAGE}=="filesystem|other|crypto", ENV{ID_FS_UUID_ENC}=="?*", SYMLINK+="disk/by-uuid/$env{ID_FS_UUID_ENC}" + ENV{ID_FS_USAGE}=="filesystem|other", ENV{ID_FS_LABEL_ENC}=="?*", SYMLINK+="disk/by-label/$env{ID_FS_LABEL_ENC}" +-- +2.33.0 + diff --git a/0024-udev-import-previous-results-of-blkid-when-in-suspen.patch b/0024-udev-import-previous-results-of-blkid-when-in-suspen.patch new file mode 100644 index 0000000000000000000000000000000000000000..c189a8e3635dd23ee896280713e9b3b9272c5ac2 --- /dev/null +++ b/0024-udev-import-previous-results-of-blkid-when-in-suspen.patch @@ -0,0 +1,55 @@ +From 05176a06cf24cd9be00bd98c76466398841008b9 Mon Sep 17 00:00:00 2001 +From: Yu Watanabe +Date: Thu, 2 Feb 2023 00:28:12 +0900 +Subject: [PATCH 2/2] udev: import previous results of blkid when in suspended + state + +Follow-up for e10f67e91728f1e576803df884049ecbd92874d0. + +The commit e10f67e91728f1e576803df884049ecbd92874d0 tries to keep device +node symlinks even if the device is in the suspended state. However, +necessary properties that may previously obtained by the blkid command +were not imported at least in the .rules file. So, unless ID_FS_xyz +properties are imported by another earlier .rules file, the device node +symlinks are still lost when event is processed in the suspended state. + +Let's explicitly import the necessary properties. + +RHBZ: https://bugzilla.redhat.com/show_bug.cgi?id=2158628 +GHPR: https://github.com/lvmteam/lvm2/pull/105 +--- + udev/13-dm-disk.rules.in | 14 ++++++++++++-- + 1 file changed, 12 insertions(+), 2 deletions(-) + +diff --git a/udev/13-dm-disk.rules.in b/udev/13-dm-disk.rules.in +index 18254b4..0ca0d57 100644 +--- a/udev/13-dm-disk.rules.in ++++ b/udev/13-dm-disk.rules.in +@@ -17,12 +17,22 @@ ENV{DM_UDEV_DISABLE_DISK_RULES_FLAG}=="1", GOTO="dm_end" + ENV{DM_NAME}=="?*", SYMLINK+="disk/by-id/dm-name-$env{DM_NAME}" + ENV{DM_UUID}=="?*", SYMLINK+="disk/by-id/dm-uuid-$env{DM_UUID}" + +-ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_link" +-ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_link" ++ENV{DM_SUSPENDED}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_import" ++ENV{DM_NOSCAN}=="1", ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", GOTO="dm_import" + ENV{DM_SUSPENDED}=="1", GOTO="dm_end" + ENV{DM_NOSCAN}=="1", GOTO="dm_watch" + + (BLKID_RULE) ++GOTO="dm_link" ++ ++LABEL="dm_import" ++IMPORT{db}="ID_FS_USAGE" ++IMPORT{db}="ID_FS_UUID_ENC" ++IMPORT{db}="ID_FS_LABEL_ENC" ++IMPORT{db}="ID_PART_ENTRY_NAME" ++IMPORT{db}="ID_PART_ENTRY_UUID" ++IMPORT{db}="ID_PART_ENTRY_SCHEME" ++IMPORT{db}="ID_PART_GPT_AUTO_ROOT" + + LABEL="dm_link" + ENV{DM_UDEV_LOW_PRIORITY_FLAG}=="1", OPTIONS="link_priority=-100" +-- +2.33.0 + diff --git a/lvm2.spec b/lvm2.spec index 99bc4bfadc77795c7b1f4c5af774d7a5a30230e8..814b0345f5849c155468c6c7897a4adc3e41a585 100644 --- a/lvm2.spec +++ b/lvm2.spec @@ -43,7 +43,7 @@ Name: lvm2 Version: 2.03.09 -Release: 13 +Release: 14 Epoch: 8 Summary: Tools for logical volume management License: GPLv2+ and LGPLv2.1 and BSD @@ -71,6 +71,8 @@ Patch19: 0019-devices-simplify-md-superblock-checking-code.patch Patch20: 0020-gcc-calc-size-in-compile-time.patch Patch21: 0021-fix-check-for-md-raid-imsm-signature-on-4k-devices.patch Patch22: 0022-clang-remove-unused-assignment.patch +Patch23: 0023-udev-create-symlinks-and-watch-even-in-suspended-sta.patch +Patch24: 0024-udev-import-previous-results-of-blkid-when-in-suspen.patch BuildRequires: gcc BuildRequires: gcc-c++ @@ -496,6 +498,9 @@ fi %changelog +* Tue Nov 14 2023 wangzhiqiang - 8:2.03.09-14 +- fix an issue for the symlink of the by-uuid file lost + * Sat Oct 29 2022 Xiaole He - 8:2.03.09-13 - backport patches:18-22 for supporting intel vroc raid(virtual raid on cpu)