lvm2/bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-rules.patch
heming zhao bde51e3862 Accepting request 1112038 from home:gsu
- Update lvm2 from LVM2.2.03.16 to LVM2.2.03.22 (jsc#PED-6339)
  *** WHATS_NEW from 2.03.17 to 2.03.22 ***
  
  version 2.03.22 - 02nd August 2023
  ==================================
    Fix pv_major/pv_minor report field types so they are integers, not strings.
    Add lvmdevices --delnotfound to delete entries for missing devices.
    Always use cachepool name for metadata backup LV for lvconvert --repair.
    Make metadata backup LVs read-only after pool's lvconvert --repair.
    Improve VDO and Thin support with lvmlockd.
    Handle 'lvextend --usepolicies' for pools for all activation variants.
    Fix memleak in vgchange autoactivation setup.
    Update py-compile building script.
    Support conversion from thick to fully provisioned thin LV.
    Cache/Thin-pool can use error and zero volumes for testing.
    Individual thin volume can be cached, but cannot take snapshot.
    Better internal support for handling error and zero target (for testing).
    Resize COW above trimmed maximal size is does not return error.
    Support parsing of vdo geometry format version 4.
    Add lvm.conf thin_restore and cache_restore settings.
    Handle multiple mounts while resizing volume with a FS.
    Handle leading/trailing spaces in sys_wwid and sys_serial used by deivce_id.
    Enhance lvm_import_vdo and use snapshot when converting VDO volume.
    Fix parsing of VDO metadata.
    Fix failing -S|--select for non-reporting cmds if using LV info/status fields.
    Allow snapshots of raid+integrity LV.
    Fix multisegment RAID1 allocator to prevent using single disk for more legs.
  version 2.03.21 - 21st April 2023
  =================================
    Fix activation of vdo-pool for with 0 length headers (converted pools).
    Avoid printing internal init messages when creation integration devices.
    Allow (write)cache over raid+integrity LV.
  version 2.03.20 - 21st March 2023
  =================================
    Fix segfault if using -S|--select with log/report_command_log=1 setting.
    Configure now fails when requested lvmlockd dependencies are missing.
    Add some configure Gentoo enhancements for static builds.
  version 2.03.19 - 21st February 2023
  ====================================
    Configure supports --with-systemd-run executed from udev rules.
    Enhancement for build with MuslC systemd and non-bash system shells (dash).
    Do not reset SYSTEMD_READY variable in udev for PVs on MD and loop devices.
    Ensure udev is processing origin LV before its thick snapshots LVs.
    Fix and improve runtime memory size detection for VDO volumes.
  version 2.03.18 - 22nd December 2022
  ====================================
    Fix issues reported by coverity scan.
    Fix warning for thin pool overprovisioning on lvextend (2.03.17).
    Add support for writecache metadata_only and pause_writeback settings.
    Fix missing error messages in lvmdbusd.
  Version 2.03.17 - 10th November 2022
  ====================================
    Add new options (--fs, --fsmode) for FS handling when resizing LVs.
    Fix 'lvremove -S|--select LV' to not also remove its historical LV right away.
    Fix lv_active field type to binary so --select and --binary applies properly.
    Switch to use mallinfo2 and use it only with glibc.
    Error out in lvm shell if using a cmd argument not supported in the shell.
    Fix lvm shell's lastlog command to report previous pre-command failures.
    Extend VDO and VDOPOOL without flushing and locking fs.
    Add --valuesonly option to lvmconfig to print only values without keys.
    Updates configure with recent autoconf tooling.
    Fix lvconvert --test --type vdo-pool execution.
    Add json_std output format for more JSON standard compliant version of output.
    Fix vdo_slab_size_mb value for converted VDO volume.
    Fix many corner cases in device_id, including handling of S/N duplicates.
    Fix various issues in lvmdbusd.
- Drop patches that have been merged into upstream
  - 0001-devices-file-move-clean-up-after-command-is-run.patch
  - 0002-devices-file-fail-if-devicesfile-filename-doesn-t-ex.patch
  - 0003-filter-mpath-handle-other-wwid-types-in-blacklist.patch
  - 0004-filter-mpath-get-wwids-from-sysfs-vpd_pg83.patch
  - 0005-pvdisplay-restore-reportformat-option.patch
  - 0006-exit-with-error-when-devicesfile-name-doesn-t-exist.patch
  - 0007-report-fix-pe_start-column-type-from-NUM-to-SIZ.patch
  - 0008-_vg_read_raw_area-fix-segfault-caused-by-using-null-.patch
  - 0009-mm-remove-libaio-from-being-skipped.patch
  - 0010-dmsetup-check-also-for-ouf-of-range-value.patch
  - 0011-devices-drop-double-from-sysfs-path.patch
  - 0012-devices-file-fix-pvcreate-uuid-matching-pvid-entry-w.patch
  - 0013-vgimportdevices-change-result-when-devices-are-not-a.patch
  - 0014-vgimportdevices-fix-locking-when-creating-devices-fi.patch
  - bug-1203216_lvmlockd-purge-the-lock-resources-left-in-previous-l.patch
  - bug-1212613_apply-multipath_component_detection-0-to-duplicate-P.patch
- Add upstream patch
  + 0001-lvconvert-swapmetadata-fix-lvmlockd-locking.patch
  + 0002-lvconvert-fix-ret-values-fro-integrity-remove.patch
  + 0003-lvconvert-fix-regresion-from-integrity-check.patch
  + 0004-gcc-cleanup-warnings.patch
  + 0005-lvmlockd-fix-thick-to-thin-lv-conversion.patch
  + 0006-lvmlockd-let-lockd_init_lv_args-set-lock_args.patch
  + 0007-lvmlockd-fix-lvconvert-to-thin-pool.patch
  + 0008-lvconvert-run-error-path-code-only-for-shared-VG.patch
  + 0009-vgchange-acquire-an-exclusive-VG-lock-for-refresh.patch
  + 0010-lvmlockd-client-mutex-ordering.patch
  + 0011-filesystem-move-stat-after-open-check.patch
  + 0012-tests-check-for-writecache.patch
  + 0013-lvresize-fix-32-bit-overflow-in-size-calculation.patch
  + 0014-gcc-fix-warnings-for-x32-architecture.patch
  + 0015-gcc-warning-missing-braces-around-initializer.patch
  + 0016-test-improve-aux-teardown.patch
  + 0017-tests-aux-try-with-extra-sleep.patch
  + 0018-tests-aux-using-singl-lvmconf-call.patch
  + 0019-tests-missing-to-check-for-writecache-support.patch
  + 0020-tests-pvmove-large-disk-area.patch
  + 0021-tests-enforce-full-fs-check.patch
  + 0022-tests-update-for-work-in-fake-dev-environment.patch
  + 0023-tests-skip-test-when-lvmdbusd-runs-on-the-system.patch
  + 0024-tests-better-slowdown.patch
- Update patch
  - bug-1037309_Makefile-skip-compliling-daemons-lvmlockd-directory.patch
  - bug-1184124-link-tests-as-PIE.patch
  - bug-1184687_Add-nolvm-for-kernel-cmdline.patch
  - fate-31841-03_tests-new-test-suite-of-fsadm-for-btrfs.patch
  
- Rename & Update patch
  - bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-metadata.patch
  + bug-1012973_simplify-special-case-for-md-in-69-dm-lvm-rules.patch
  
- update lvm2.spec
  - change upstream_device_mapper_version to 1.02.196
  - change device_mapper_version to %{lvm2_version}_1.02.196
  - add config item "-with-libexecdir=%{_libexecdir}" to fix libexec path since commit a2d33cdf
  - add new binary "%{_libexecdir}/lvresize_fs_helper" to lvm2 package

OBS-URL: https://build.opensuse.org/request/show/1112038
OBS-URL: https://build.opensuse.org/package/show/Base:System/lvm2?expand=0&rev=332
2023-09-19 00:36:45 +00:00

67 lines
2.6 KiB
Diff

From 5633a8ad6522f0f1340ef35c2f3943a3b20cc200 Mon Sep 17 00:00:00 2001
From: NeilBrown <neilb@suse.com>
Date: Wed, 4 Jan 2017 14:20:53 +1100
Subject: [PATCH] Simplify special-case for md in 69-dm-lvm.rules.in
This special casing brings little value. It appears to attempt to
determine if the array is active yet or not, and to skip
processing if the array has not yet been started.
However, if the array hasn't been started, then "blkid" will
not have been able to read a signature, so:
ENV{ID_FS_TYPE}!="LVM2_member|LVM1_member", GOTO="lvm_end"
will have caused all this code to be skipped.
Further, this code causes incorrect behaviour in at least one case.
It assumes that the first "add" event should be ignored, as it will be
followed by a "change" event which indicates the array coming on line.
This is consistent with how the kernel sends events, but not always
consistent with how this script sees event.
Specifically: if the initrd has "mdadm" support installed, but not
"lvm2" support, then the initial "add" and "change" events will
happen while the initrd is in charge and this file is not available.
Once the root filesystem is mountd, this file will be available
and "udevadm trigger --action=add" will be run.
So the first and only event seen by this script for an md device will be
"add", and it will incorrectly ignore it.
So replace the special handling with code that simply jumps to lvm_scan
on any 'add' or 'change' event.
Signed-off-by: NeilBrown <neilb@suse.com>
2023-09-18:
udev/69-dm-lvm-metadata.rules was removed in v2_03_09 and 69-dm-lvm.rules.in
should be modified instead. The subject of this patch should be modified too.
NOTE: the updated patch may let shell/duplicate-pvs-md0.sh fail because
we change timing of lvm_scan in the rule file.
Signed-off-by: Glass Su <glass.su@suse.com>
---
udev/69-dm-lvm.rules.in | 7 +++----
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
index 3ec50a5cb878..45fdad444562 100644
--- a/udev/69-dm-lvm.rules.in
+++ b/udev/69-dm-lvm.rules.in
@@ -35,12 +35,11 @@ ENV{DM_UDEV_PRIMARY_SOURCE_FLAG}=="1", ENV{DM_ACTIVATION}=="1", GOTO="lvm_scan"
GOTO="lvm_end"
# MD device:
+# Need to scan on both 'add' and 'change'
LABEL="next"
KERNEL!="md[0-9]*", GOTO="next"
-IMPORT{db}="LVM_MD_PV_ACTIVATED"
-ACTION=="add", ENV{LVM_MD_PV_ACTIVATED}=="1", GOTO="lvm_scan"
-ACTION=="change", ENV{LVM_MD_PV_ACTIVATED}!="1", TEST=="md/array_state", ENV{LVM_MD_PV_ACTIVATED}="1", GOTO="lvm_scan"
-ACTION=="add", KERNEL=="md[0-9]*p[0-9]*", GOTO="lvm_scan"
+ACTION=="add", GOTO="lvm_scan"
+ACTION=="change", GOTO="lvm_scan"
GOTO="lvm_end"
# Loop device:
--
2.42.0