Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package lvm2 for openSUSE:Factory checked in 
at 2022-09-06 13:00:44
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/lvm2 (Old)
 and      /work/SRC/openSUSE:Factory/.lvm2.new.2083 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "lvm2"

Tue Sep  6 13:00:44 2022 rev:154 rq:1001168 version:2.03.16

Changes:
--------
--- /work/SRC/openSUSE:Factory/lvm2/lvm2.changes        2022-04-02 
18:19:56.454678960 +0200
+++ /work/SRC/openSUSE:Factory/.lvm2.new.2083/lvm2.changes      2022-09-06 
13:00:53.934946651 +0200
@@ -1,0 +2,73 @@
+Thu Sep  1 02:50:00 UTC 2022 - Heming Zhao <heming.z...@suse.com>
+
+- Update lvm2 from LVM2.2.03.15 to LVM2.2.03.16
+
+  *** WHATS_NEW for 2.03.16 ***
+
+  Version 2.03.16 - 18th May 2022
+  ===============================
+    Fix segfault when handling selection with historical LVs.
+    Add support --vdosettings with lvcreate, lvconvert, lvchange.
+    Filtering multipath devices respects blacklist setting from multipath 
configuration.
+    lvmdevices support for removing by device id using --deviceidtype and 
--deldev.
+    Display writecache block size with lvs -o writecache_block_size.
+    Improve cachesettings description in man lvmcache.
+    Fix lossing of delete message on thin-pool extension.
+
+- Drop patches that have been merged into upstream
+  - 0001-post-release.patch
+  - 0002-asan-fix-some-reports-from-libasan.patch
+  - 0003-make-generate.patch
+  - 0004-tests-udev-pvscan-vgchange-fix-service-wait.patch
+  - 0005-devices-file-do-not-clear-PVID-of-unread-devices.patch
+  - 0006-tests-skip-vgchange-pvs-online.sh-on-rhel5.patch
+  - 0007-dev_manager-fix-dm_task_get_device_list.patch
+  - 0008-dev_manager-failing-status-is-not-internal-error.patch
+  - 0009-clang-add-extra-check.patch
+  - 0010-clang-possible-better-compilation-with-musl-c.patch
+  - 0011-dev_manager-do-not-query-for-open_count.patch
+  - 0012-dev_manager-use-list-info-for-preset-devs.patch
+  - 0013-man-lvmcache-add-more-writecache-cachesettings-info.patch
+  - 0014-man-update-cachesettings-option-description.patch
+  - 0015-man-lvmcache-mention-writecache-memory-usage.patch
+  - 0016-writecache-display-block-size-from-lvs.patch
+  - 0017-devices-simplify-dev_cache_get_by_devt.patch
+  - 0018-devices-drop-incorrect-paths-from-aliases-list.patch
+  - 0019-devices-initial-use-of-existing-option.patch
+  - 0020-devices-fix-dev_name-assumptions.patch
+  - 0021-devices-use-dev-cache-aliases-handling-from-label-sc.patch
+  - 0022-devices-only-close-PVs-on-LVs-when-scan_lvs-is-enabl.patch
+  - 0023-writecache-check-memory-usage.patch
+  - 0024-pvscan-don-t-use-udev-for-external-device-info.patch
+  - 0025-vgchange-monitor-don-t-use-udev-info.patch
+
+- Add upstream patch
+  - 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
+
+- Update patch
+  - bug-1184687_Add-nolvm-for-kernel-cmdline.patch
+
+- update lvm2.spec
+  - indent some lines for easy read
+  - add new man: lvm_import_vdo.8 dmfilemapd.8
+  - remove config item '--enable-cmirrord', which was obsoleted.
+  - remove config item '--enable-realtime', which became default setting.
+  - add config item "--enable-dmfilemapd" for new daemon dmfilemapd
+
+- lvm.conf
+  - align upstream style, comment out default values
+
+-------------------------------------------------------------------

Old:
----
  0001-post-release.patch
  0002-asan-fix-some-reports-from-libasan.patch
  0003-make-generate.patch
  0004-tests-udev-pvscan-vgchange-fix-service-wait.patch
  0005-devices-file-do-not-clear-PVID-of-unread-devices.patch
  0006-tests-skip-vgchange-pvs-online.sh-on-rhel5.patch
  0007-dev_manager-fix-dm_task_get_device_list.patch
  0008-dev_manager-failing-status-is-not-internal-error.patch
  0009-clang-add-extra-check.patch
  0010-clang-possible-better-compilation-with-musl-c.patch
  0011-dev_manager-do-not-query-for-open_count.patch
  0012-dev_manager-use-list-info-for-preset-devs.patch
  0013-man-lvmcache-add-more-writecache-cachesettings-info.patch
  0014-man-update-cachesettings-option-description.patch
  0015-man-lvmcache-mention-writecache-memory-usage.patch
  0016-writecache-display-block-size-from-lvs.patch
  0017-devices-simplify-dev_cache_get_by_devt.patch
  0018-devices-drop-incorrect-paths-from-aliases-list.patch
  0019-devices-initial-use-of-existing-option.patch
  0020-devices-fix-dev_name-assumptions.patch
  0021-devices-use-dev-cache-aliases-handling-from-label-sc.patch
  0022-devices-only-close-PVs-on-LVs-when-scan_lvs-is-enabl.patch
  0023-writecache-check-memory-usage.patch
  0024-pvscan-don-t-use-udev-for-external-device-info.patch
  0025-vgchange-monitor-don-t-use-udev-info.patch
  LVM2.2.03.15.tgz
  LVM2.2.03.15.tgz.asc

New:
----
  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
  LVM2.2.03.16.tgz
  LVM2.2.03.16.tgz.asc

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ lvm2.spec ++++++
--- /var/tmp/diff_new_pack.r4SqXY/_old  2022-09-06 13:00:54.806948852 +0200
+++ /var/tmp/diff_new_pack.r4SqXY/_new  2022-09-06 13:00:54.810948862 +0200
@@ -21,7 +21,7 @@
 %define libname_event libdevmapper-event1_03
 %define _udevdir %(pkg-config --variable=udevdir udev)
 %define cmdlib liblvm2cmd2_03
-%define lvm2_version              2.03.15
+%define lvm2_version              2.03.16
 %define device_mapper_version     1.02.185
 %define thin_provisioning_version 0.7.0
 %define _supportsanlock 0
@@ -32,23 +32,28 @@
 %define lvm2_cmirrord_version 2.03
 %define liblvm2app2_2_version 2.03
 %define liblvm2cmd2_02_version 2.03
+
 %if 0%{_supportsanlock} == 1
-%define sanlock_version 3.3.0
+  %define sanlock_version 3.3.0
 %endif
+
 %global flavor @BUILD_FLAVOR@%{nil}
 %define psuffix %{nil}
+
 %if "%{flavor}" == "devicemapper"
-%define psuffix -device-mapper
-%bcond_without devicemapper
+  %define psuffix -device-mapper
+  %bcond_without devicemapper
 %else
-%bcond_with devicemapper
+  %bcond_with devicemapper
 %endif
+
 %if "%{flavor}" == "lockd"
-%define psuffix -lvmlockd
-%bcond_without lockd
+  %define psuffix -lvmlockd
+  %bcond_without lockd
 %else
-%bcond_with lockd
+  %bcond_with lockd
 %endif
+
 Name:           lvm2%{psuffix}
 Version:        %{lvm2_version}
 Release:        0
@@ -63,31 +68,20 @@
 Source99:       baselibs.conf
 
 # Upstream patches
-Patch0001:      0001-post-release.patch
-Patch0002:      0002-asan-fix-some-reports-from-libasan.patch
-Patch0003:      0003-make-generate.patch
-Patch0004:      0004-tests-udev-pvscan-vgchange-fix-service-wait.patch
-Patch0005:      0005-devices-file-do-not-clear-PVID-of-unread-devices.patch
-Patch0006:      0006-tests-skip-vgchange-pvs-online.sh-on-rhel5.patch
-Patch0007:      0007-dev_manager-fix-dm_task_get_device_list.patch
-Patch0008:      0008-dev_manager-failing-status-is-not-internal-error.patch
-Patch0009:      0009-clang-add-extra-check.patch
-Patch0010:      0010-clang-possible-better-compilation-with-musl-c.patch
-Patch0011:      0011-dev_manager-do-not-query-for-open_count.patch
-Patch0012:      0012-dev_manager-use-list-info-for-preset-devs.patch
-Patch0013:      0013-man-lvmcache-add-more-writecache-cachesettings-info.patch
-Patch0014:      0014-man-update-cachesettings-option-description.patch
-Patch0015:      0015-man-lvmcache-mention-writecache-memory-usage.patch
-Patch0016:      0016-writecache-display-block-size-from-lvs.patch
-Patch0017:      0017-devices-simplify-dev_cache_get_by_devt.patch
-Patch0018:      0018-devices-drop-incorrect-paths-from-aliases-list.patch
-Patch0019:      0019-devices-initial-use-of-existing-option.patch
-Patch0020:      0020-devices-fix-dev_name-assumptions.patch
-Patch0021:      0021-devices-use-dev-cache-aliases-handling-from-label-sc.patch
-Patch0022:      0022-devices-only-close-PVs-on-LVs-when-scan_lvs-is-enabl.patch
-Patch0023:      0023-writecache-check-memory-usage.patch
-Patch0024:      0024-pvscan-don-t-use-udev-for-external-device-info.patch
-Patch0025:      0025-vgchange-monitor-don-t-use-udev-info.patch
+Patch0001:      0001-devices-file-move-clean-up-after-command-is-run.patch
+Patch0002:      0002-devices-file-fail-if-devicesfile-filename-doesn-t-ex.patch
+Patch0003:      0003-filter-mpath-handle-other-wwid-types-in-blacklist.patch
+Patch0004:      0004-filter-mpath-get-wwids-from-sysfs-vpd_pg83.patch
+Patch0005:      0005-pvdisplay-restore-reportformat-option.patch
+Patch0006:      0006-exit-with-error-when-devicesfile-name-doesn-t-exist.patch
+Patch0007:      0007-report-fix-pe_start-column-type-from-NUM-to-SIZ.patch
+Patch0008:      0008-_vg_read_raw_area-fix-segfault-caused-by-using-null-.patch
+Patch0009:      0009-mm-remove-libaio-from-being-skipped.patch
+Patch0010:      0010-dmsetup-check-also-for-ouf-of-range-value.patch
+Patch0011:      0011-devices-drop-double-from-sysfs-path.patch
+Patch0012:      0012-devices-file-fix-pvcreate-uuid-matching-pvid-entry-w.patch
+Patch0013:      0013-vgimportdevices-change-result-when-devices-are-not-a.patch
+Patch0014:      0014-vgimportdevices-fix-locking-when-creating-devices-fi.patch
 # SUSE patches: 1000+ for LVM
 # Never upstream
 Patch1001:      cmirrord_remove_date_time_from_compilation.patch
@@ -117,6 +111,7 @@
 Provides:       lvm = %{version}
 Obsoletes:      lvm2-cmirrord <= %{lvm2_cmirrord_version}
 %{?systemd_requires}
+
 %if %{with devicemapper}
 BuildRequires:  gcc-c++
 BuildRequires:  suse-module-tools
@@ -161,17 +156,6 @@
 %patch0012 -p1
 %patch0013 -p1
 %patch0014 -p1
-%patch0015 -p1
-%patch0016 -p1
-%patch0017 -p1
-%patch0018 -p1
-%patch0019 -p1
-%patch0020 -p1
-%patch0021 -p1
-%patch0022 -p1
-%patch0023 -p1
-%patch0024 -p1
-%patch0025 -p1
 %patch1001 -p1
 %patch1002 -p1
 %patch1003 -p1
@@ -191,23 +175,22 @@
 %if !%{with devicemapper} && !%{with lockd}
 extra_opts="
     --enable-blkid_wiping
-    --enable-realtime
     --with-cache=internal
        --with-writecache=internal
+    --with-integrity=internal
     --with-default-locking-dir=/run/lock/lvm
     --with-default-pid-dir=/run
     --with-default-run-dir=/run/lvm
-    --enable-cmirrord
     --enable-fsadm
     --enable-write_install
     --with-vdo=internal
     --with-vdo-format=%{_bindir}/vdoformat
 "
 %endif
+
 %if %{with lockd}
 extra_opts="
     --enable-blkid_wiping
-    --enable-realtime
     --with-default-locking-dir=/run/lock/lvm
     --with-default-pid-dir=/run
     --with-default-run-dir=/run/lvm
@@ -226,6 +209,7 @@
 sed -ie "s/%{device_mapper_version}/1.03.01/g" VERSION_DM
 %configure \
     --enable-dmeventd \
+    --enable-dmfilemapd \
     --enable-lvmpolld \
     --enable-cmdlib \
     --enable-udev_rules \
@@ -245,121 +229,131 @@
     --with-thin-check=%{_sbindir}/thin_check \
     --with-thin-dump=%{_sbindir}/thin_dump \
     --with-thin-repair=%{_sbindir}/thin_repair \
-    --with-integrity=internal \
     --disable-silent-rules \
     $extra_opts
 ### COMMON-CONFIG-END ###
 
 %if %{with devicemapper}
-%make_build device-mapper
+  %make_build device-mapper
 %else
-%make_build
+  %make_build
 %endif
 
 %install
 %if %{with devicemapper}
-make DESTDIR=%{buildroot} \
+  make DESTDIR=%{buildroot} \
     install_device-mapper \
     install_systemd_units
 
-ln -s service %{buildroot}/%{_sbindir}/rcdm-event
+  ln -s service %{buildroot}/%{_sbindir}/rcdm-event
 
-# provide 1.02 compat links for the shared libraries
-# this is needed for various binary packages
-ln -s libdevmapper.so.1.03 %{buildroot}/%{_libdir}/libdevmapper.so.1.02
-ln -s libdevmapper-event.so.1.03 
%{buildroot}/%{_libdir}/libdevmapper-event.so.1.02
-
-# remove blkd, will be in lvm2 proper
-# without force on purpose to detect changes and fail if it happens
-rm %{buildroot}%{_sbindir}/blkdeactivate
-rm %{buildroot}%{_unitdir}/blk-availability.service
-rm %{buildroot}%{_unitdir}/lvm2-monitor.service
-rm %{buildroot}%{_mandir}/man8/blkdeactivate.8
+  # provide 1.02 compat links for the shared libraries
+  # this is needed for various binary packages
+  ln -s libdevmapper.so.1.03 %{buildroot}/%{_libdir}/libdevmapper.so.1.02
+  ln -s libdevmapper-event.so.1.03 
%{buildroot}/%{_libdir}/libdevmapper-event.so.1.02
+
+  # remove blkd, will be in lvm2 proper
+  # without force on purpose to detect changes and fail if it happens
+  rm %{buildroot}%{_sbindir}/blkdeactivate
+  rm %{buildroot}%{_unitdir}/blk-availability.service
+  rm %{buildroot}%{_unitdir}/lvm2-monitor.service
+  rm %{buildroot}%{_mandir}/man8/blkdeactivate.8
+
+  # remove files, which will be in lvm2 & lockd packages
+  rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.service
+  rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.socket
+  rm %{buildroot}%{_unitdir}/lvmlockd.service
+  rm %{buildroot}%{_unitdir}/lvmlocks.service
+
+  # compat symlinks in /sbin remove with Leap 43
+  %if !0%{?usrmerged}
+  mkdir -p %{buildroot}/sbin
+  ln -s %{_sbindir}/dmsetup %{buildroot}/sbin/dmsetup
+  %endif
 
-# compat symlinks in /sbin remove with Leap 43
-%if !0%{?usrmerged}
-mkdir -p %{buildroot}/sbin
-ln -s %{_sbindir}/dmsetup %{buildroot}/sbin/dmsetup
-%endif
 %else
-%if %{with lockd}
-make DESTDIR=%{buildroot} \
+
+  %if %{with lockd}
+    make DESTDIR=%{buildroot} \
     install_systemd_units install_systemd_generators
-make DESTDIR=%{buildroot} install -C daemons/lvmlockd
+    make DESTDIR=%{buildroot} install -C daemons/lvmlockd
 
-# lvmlockd does not have separate target install the mans by hand for now
-install -m0644 -D man/lvmlockd.8 %{buildroot}%{_mandir}/man8/lvmlockd.8
-install -m0644 -D man/lvmlockctl.8 %{buildroot}%{_mandir}/man8/lvmlockctl.8
-
-# rc services symlinks
-ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmlockd
-ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmlocking
-
-# remove files from lvm2 split due to systemd_generators picking them up
-rm %{buildroot}%{_unitdir}/blk-availability.service
-rm %{buildroot}%{_unitdir}/dm-event.service
-rm %{buildroot}%{_unitdir}/dm-event.socket
-rm %{buildroot}%{_unitdir}/lvm2-monitor.service
-rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.service
-rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.socket
-%else
-%make_install
-make install_system_dirs DESTDIR=%{buildroot}
-make install_systemd_units DESTDIR=%{buildroot}
-make install_systemd_generators DESTDIR=%{buildroot}
-make install_tmpfiles_configuration DESTDIR=%{buildroot}
-# Install configuration file
-install -m 644 %{SOURCE1} "%{buildroot}/%{_sysconfdir}/lvm/"
-# Install testsuite
-make -C test install DESTDIR=%{buildroot}
-
-pushd "%{buildroot}/%{_libdir}"
-ln -sf liblvm2cmd.so.2.03 liblvm2cmd.so
-for i in libdevmapper-event-lvm2{mirror,raid,snapshot,thin}; do
+    # lvmlockd does not have separate target install the mans by hand for now
+    install -m0644 -D man/lvmlockd.8 %{buildroot}%{_mandir}/man8/lvmlockd.8
+    install -m0644 -D man/lvmlockctl.8 %{buildroot}%{_mandir}/man8/lvmlockctl.8
+
+    # rc services symlinks
+    ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmlockd
+    ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmlocking
+
+    # remove files from lvm2 split due to systemd_generators picking them up
+    rm %{buildroot}%{_unitdir}/blk-availability.service
+    rm %{buildroot}%{_unitdir}/dm-event.service
+    rm %{buildroot}%{_unitdir}/dm-event.socket
+    rm %{buildroot}%{_unitdir}/lvm2-monitor.service
+    rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.service
+    rm %{buildroot}%{_unitdir}/lvm2-lvmpolld.socket
+  %else
+    %make_install
+    make install_system_dirs DESTDIR=%{buildroot}
+    make install_systemd_units DESTDIR=%{buildroot}
+    make install_systemd_generators DESTDIR=%{buildroot}
+    make install_tmpfiles_configuration DESTDIR=%{buildroot}
+    # Install configuration file
+    install -m 644 %{SOURCE1} "%{buildroot}/%{_sysconfdir}/lvm/"
+    # Install testsuite
+    make -C test install DESTDIR=%{buildroot}
+
+    pushd "%{buildroot}/%{_libdir}"
+    ln -sf liblvm2cmd.so.2.03 liblvm2cmd.so
+    for i in libdevmapper-event-lvm2{mirror,raid,snapshot,thin}; do
     ln -sf "device-mapper/$i.so" "$i.so"
     ln -sf "device-mapper/$i.so" "$i.so.2.03"
-done
-popd
-
-#rc compat symlinks
-ln -s service %{buildroot}%{_sbindir}/rcblk-availability
-ln -s service %{buildroot}%{_sbindir}/rclvm2-monitor
-ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmpolld
-
-# Remove devicemapper binaries, plain rm so we fail if something change
-rm %{buildroot}%{_sbindir}/dmsetup
-rm %{buildroot}%{_sbindir}/dmeventd
-rm %{buildroot}%{_sbindir}/dmstats
-rm %{buildroot}%{_udevrulesdir}/10-dm.rules
-rm %{buildroot}%{_udevrulesdir}/13-dm-disk.rules
-rm %{buildroot}%{_udevrulesdir}/95-dm-notify.rules
-rm %{buildroot}%{_unitdir}/dm-event.socket
-rm %{buildroot}%{_unitdir}/dm-event.service
-# See bsc#1037309 for more info
-rm %{buildroot}%{_unitdir}/lvmlockd.service
-rm %{buildroot}%{_unitdir}/lvmlocks.service
-rm %{buildroot}%{_includedir}/libdevmapper*.h
-rm %{buildroot}%{_libdir}/libdevmapper.so.*
-rm %{buildroot}%{_libdir}/libdevmapper-event.so.*
-rm %{buildroot}%{_libdir}/libdevmapper.so
-rm %{buildroot}%{_libdir}/libdevmapper-event.so
-rm %{buildroot}%{_libdir}/pkgconfig/devmapper*.pc
-rm %{buildroot}%{_mandir}/man8/lvmlockctl.8
-rm %{buildroot}%{_mandir}/man8/lvmlockd.8
-rm %{buildroot}%{_mandir}/man8/dmstats.8
-rm %{buildroot}%{_mandir}/man8/dmsetup.8
-rm %{buildroot}%{_mandir}/man8/dmeventd.8
+    done
+    popd
 
-%if !0%{?usrmerged}
-# compat symlinks in /sbin remove with Leap 43
-mkdir -p %{buildroot}/sbin
-pushd %{buildroot}/%{_sbindir}
-for i in {vg,pv,lv}*; do
+    #rc compat symlinks
+    ln -s service %{buildroot}%{_sbindir}/rcblk-availability
+    ln -s service %{buildroot}%{_sbindir}/rclvm2-monitor
+    ln -s service %{buildroot}%{_sbindir}/rclvm2-lvmpolld
+
+    # Remove devicemapper binaries, plain rm so we fail if something change
+    rm %{buildroot}%{_sbindir}/dmsetup
+    rm %{buildroot}%{_sbindir}/dmeventd
+    rm %{buildroot}%{_sbindir}/dmstats
+    rm %{buildroot}%{_sbindir}/dmfilemapd
+    rm %{buildroot}%{_udevrulesdir}/10-dm.rules
+    rm %{buildroot}%{_udevrulesdir}/13-dm-disk.rules
+    rm %{buildroot}%{_udevrulesdir}/95-dm-notify.rules
+    rm %{buildroot}%{_unitdir}/dm-event.socket
+    rm %{buildroot}%{_unitdir}/dm-event.service
+    # See bsc#1037309 for more info
+    rm %{buildroot}%{_unitdir}/lvmlockd.service
+    rm %{buildroot}%{_unitdir}/lvmlocks.service
+    rm %{buildroot}%{_includedir}/libdevmapper*.h
+    rm %{buildroot}%{_libdir}/libdevmapper.so.*
+    rm %{buildroot}%{_libdir}/libdevmapper-event.so.*
+    rm %{buildroot}%{_libdir}/libdevmapper.so
+    rm %{buildroot}%{_libdir}/libdevmapper-event.so
+    rm %{buildroot}%{_libdir}/pkgconfig/devmapper*.pc
+    rm %{buildroot}%{_mandir}/man8/lvmlockctl.8
+    rm %{buildroot}%{_mandir}/man8/lvmlockd.8
+    rm %{buildroot}%{_mandir}/man8/dmstats.8
+    rm %{buildroot}%{_mandir}/man8/dmsetup.8
+    rm %{buildroot}%{_mandir}/man8/dmeventd.8
+    rm %{buildroot}%{_mandir}/man8/dmfilemapd.8
+
+    %if !0%{?usrmerged}
+      # compat symlinks in /sbin remove with Leap 43
+      mkdir -p %{buildroot}/sbin
+      pushd %{buildroot}/%{_sbindir}
+      for i in {vg,pv,lv}*; do
     ln -s %{_sbindir}/$i %{buildroot}/sbin/$i
-done
-popd
-%endif
-%endif
+      done
+      popd
+    %endif
+
+  %endif
 %endif
 
 %if %{with devicemapper}
@@ -401,9 +395,11 @@
 %{_sbindir}/dmsetup
 %{_sbindir}/dmeventd
 %{_sbindir}/dmstats
+%{_sbindir}/dmfilemapd
 %{_mandir}/man8/dmstats.8%{?ext_man}
 %{_mandir}/man8/dmsetup.8%{?ext_man}
 %{_mandir}/man8/dmeventd.8%{?ext_man}
+%{_mandir}/man8/dmfilemapd.8%{?ext_man}
 %{_udevrulesdir}/10-dm.rules
 %{_udevrulesdir}/13-dm-disk.rules
 %{_udevrulesdir}/95-dm-notify.rules
@@ -557,7 +553,6 @@
 %{_sbindir}/lvmdump
 %{_sbindir}/lvmpolld
 %{_sbindir}/lvm_import_vdo
-# Other files
 %{_sbindir}/lvchange
 %{_sbindir}/lvconvert
 %{_sbindir}/lvcreate
@@ -607,11 +602,11 @@
 # compat symlinks in /sbin
 %if !0%{?usrmerged}
 /sbin/lvm
-/sbin/lvm_import_vdo
 /sbin/lvmconfig
 /sbin/lvmdevices
 /sbin/lvmdump
 /sbin/lvmpolld
+/sbin/lvm_import_vdo
 /sbin/lvchange
 /sbin/lvconvert
 /sbin/lvcreate
@@ -718,6 +713,7 @@
 %{_mandir}/man8/blkdeactivate.8%{?ext_man}
 %{_mandir}/man8/lvmpolld.8%{?ext_man}
 %{_mandir}/man8/lvm-lvpoll.8%{?ext_man}
+%{_mandir}/man8/lvm_import_vdo.8%{?ext_man}
 %{_udevdir}/rules.d/11-dm-lvm.rules
 %{_udevdir}/rules.d/69-dm-lvm.rules
 %dir %{_sysconfdir}/lvm

++++++ 0001-devices-file-move-clean-up-after-command-is-run.patch ++++++
>From 9dfa6f38793f6b5f7de2a4148ab2f7790e3c39da Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Fri, 27 May 2022 12:38:43 -0500
Subject: [PATCH] devices file: move clean up after command is run

devices_file_exit wasn't being called between lvm_shell
commands, so the file lock wouldn't be released.
---
 lib/commands/toolcontext.c | 2 --
 tools/lvmcmdline.c         | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c
index 4cb81bf94279..2666d7b42be6 100644
--- a/lib/commands/toolcontext.c
+++ b/lib/commands/toolcontext.c
@@ -1905,7 +1905,6 @@ int refresh_toolcontext(struct cmd_context *cmd)
        _destroy_segtypes(&cmd->segtypes);
        _destroy_formats(cmd, &cmd->formats);
 
-       devices_file_exit(cmd);
        if (!dev_cache_exit())
                stack;
        _destroy_dev_types(cmd);
@@ -2034,7 +2033,6 @@ void destroy_toolcontext(struct cmd_context *cmd)
        _destroy_segtypes(&cmd->segtypes);
        _destroy_formats(cmd, &cmd->formats);
        _destroy_filters(cmd);
-       devices_file_exit(cmd);
        dev_cache_exit();
        _destroy_dev_types(cmd);
        _destroy_tags(cmd);
diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c
index 1e3547ed72f3..b052d698fed7 100644
--- a/tools/lvmcmdline.c
+++ b/tools/lvmcmdline.c
@@ -3305,6 +3305,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, 
char **argv)
        hints_exit(cmd);
        lvmcache_destroy(cmd, 1, 1);
        label_scan_destroy(cmd);
+       devices_file_exit(cmd);
 
        if ((config_string_cft = remove_config_tree_by_source(cmd, 
CONFIG_STRING)))
                dm_config_destroy(config_string_cft);
-- 
2.26.2


++++++ 0002-devices-file-fail-if-devicesfile-filename-doesn-t-ex.patch ++++++
>From bfe072e4388b530cbf5369be8a8f1305220198bf Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Fri, 27 May 2022 14:27:03 -0500
Subject: [PATCH] devices file: fail if --devicesfile filename doesn't exist

A typo of the filename after --devicesfile should result in a
command error rather than the command falling back to using no
devices file at all.  Exception is vgcreate|pvcreate which
create a new devices file if the file name doesn't exist.
---
 lib/device/dev-cache.c          | 9 +++++++++
 test/shell/devicesfile-basic.sh | 4 ++++
 2 files changed, 13 insertions(+)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 3aaf6a2e55b8..ed9c726c9748 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1863,6 +1863,15 @@ int setup_devices(struct cmd_context *cmd)
 
        file_exists = devices_file_exists(cmd);
 
+       /*
+        * Fail if user specifies a file name that doesn't exist and
+        * the command is not creating a new devices file.
+        */
+       if (!file_exists && !cmd->create_edit_devices_file && cmd->devicesfile 
&& strlen(cmd->devicesfile)) {
+               log_error("Devices file not found: %s", cmd->devices_file_path);
+               return 0;
+       }
+
        /*
         * Removing the devices file is another way of disabling the use of
         * a devices file, unless the command creates the devices file.
diff --git a/test/shell/devicesfile-basic.sh b/test/shell/devicesfile-basic.sh
index 9c3455c7678e..77fe265a0c54 100644
--- a/test/shell/devicesfile-basic.sh
+++ b/test/shell/devicesfile-basic.sh
@@ -104,6 +104,10 @@ not ls "$DFDIR/system.devices"
 vgs --devicesfile test.devices $vg1
 not vgs --devicesfile test.devices $vg2
 
+# misspelled override name fails
+not vgs --devicesfile doesnotexist $vg1
+not vgs --devicesfile doesnotexist $vg2
+
 # devicesfile and devices cannot be used together
 not vgs --devicesfile test.devices --devices "$dev1","$dev1" $vg1
 
-- 
2.26.2


++++++ 0003-filter-mpath-handle-other-wwid-types-in-blacklist.patch ++++++
>From c302903dbab1d5fd05b344c654bed83c9ecb69f8 Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Mon, 6 Jun 2022 11:39:02 -0500
Subject: [PATCH] filter-mpath: handle other wwid types in blacklist

Fixes commit 494372b4eed0c8f6040e3357939eb7511ac25745
  "filter-mpath: use multipath blacklist"
to handle wwids with initial type digits 1 and 2 used
for t10 and eui ids.  Originally recognized type 3 naa.
---
 lib/device/dev-mpath.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/lib/device/dev-mpath.c b/lib/device/dev-mpath.c
index 270366ad7cfe..846f6c8bab13 100644
--- a/lib/device/dev-mpath.c
+++ b/lib/device/dev-mpath.c
@@ -54,7 +54,7 @@ static void _read_blacklist_file(const char *path)
        int section_black = 0;
        int section_exceptions = 0;
        int found_quote;
-       int found_three;
+       int found_type;
        int i, j;
 
        if (!(fp = fopen(path, "r")))
@@ -114,7 +114,7 @@ static void _read_blacklist_file(const char *path)
 
                memset(wwid, 0, sizeof(wwid));
                found_quote = 0;
-               found_three = 0;
+               found_type = 0;
                j = 0;
 
                for (; i < MAX_WWID_LINE; i++) {
@@ -132,9 +132,10 @@ static void _read_blacklist_file(const char *path)
                        /* second quote is end of wwid */
                        if ((line[i] == '"') && found_quote)
                                break;
-                       /* ignore first "3" in wwid */
-                       if ((line[i] == '3') && !found_three) {
-                               found_three = 1;
+                       /* exclude initial 3/2/1 for naa/eui/t10 */
+                       if (!j && !found_type &&
+                           ((line[i] == '3') || (line[i] == '2') || (line[i] 
== '1'))) {
+                               found_type = 1;
                                continue;
                        }
 
-- 
2.26.2


++++++ 0004-filter-mpath-get-wwids-from-sysfs-vpd_pg83.patch ++++++
++++ 742 lines (skipped)

++++++ 0005-pvdisplay-restore-reportformat-option.patch ++++++
>From db5277c97155632ce83e1125e348eda97c871968 Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Fri, 24 Jun 2022 10:40:54 -0500
Subject: [PATCH] pvdisplay: restore --reportformat option

Fixes commit b8f4ec846 "display: ignore --reportformat"
by restoring the --reportformat option to pvdisplay.
Adding -C to pvdisplay turns the command into a reporting
command (like pvs, vgs, lvs) in which --reportformat can
be useful.
---
 tools/command-lines.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/command-lines.in b/tools/command-lines.in
index b64fd0dda232..b6a03d158daa 100644
--- a/tools/command-lines.in
+++ b/tools/command-lines.in
@@ -1593,10 +1593,10 @@ pvdisplay
 OO: --aligned, --all, --binary, --colon, --columns, --configreport 
ConfigReport,
 --foreign, --ignorelockingfailure,
 --logonly, --maps, --noheadings, --nosuffix, --options String,
---readonly, --select String, --separator String, --shared,
+--readonly, --reportformat ReportFmt, --select String, --separator String, 
--shared,
 --short, --sort String, --unbuffered, --units Units
 OP: PV|Tag ...
-IO: --ignoreskippedcluster, --reportformat ReportFmt
+IO: --ignoreskippedcluster
 ID: pvdisplay_general
 
 ---
-- 
2.26.2


++++++ 0006-exit-with-error-when-devicesfile-name-doesn-t-exist.patch ++++++
>From 92b4fcf57f3c6d212d06b72b097e1a06e6efb84b Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Tue, 5 Jul 2022 17:08:00 -0500
Subject: [PATCH] exit with error when --devicesfile name doesn't exist

---
 lib/cache/lvmcache.c            |  3 ++-
 lib/label/label.c               |  4 ++--
 test/shell/devicesfile-basic.sh |  1 +
 tools/pvcreate.c                |  3 ++-
 tools/pvremove.c                |  3 ++-
 tools/pvscan.c                  |  3 ++-
 tools/toollib.c                 | 27 +++++++++++++++++++++------
 tools/vgcfgrestore.c            |  5 ++++-
 tools/vgcreate.c                |  5 ++++-
 tools/vgextend.c                |  3 ++-
 tools/vgmerge.c                 |  3 ++-
 tools/vgsplit.c                 |  3 ++-
 12 files changed, 46 insertions(+), 17 deletions(-)

diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 22edcfd849e3..a1c4a61c82fa 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1612,7 +1612,8 @@ int lvmcache_label_scan(struct cmd_context *cmd)
         * with infos/vginfos based on reading headers from
         * each device, and a vg summary from each mda.
         */
-       label_scan(cmd);
+       if (!label_scan(cmd))
+               return_0;
 
        /*
         * When devnames are used as device ids (which is dispreferred),
diff --git a/lib/label/label.c b/lib/label/label.c
index 711edb6f4085..f845abb9640f 100644
--- a/lib/label/label.c
+++ b/lib/label/label.c
@@ -801,7 +801,7 @@ static int _setup_bcache(void)
        }
 
        if (!(scan_bcache = bcache_create(BCACHE_BLOCK_SIZE_IN_SECTORS, 
cache_blocks, ioe))) {
-               log_error("Failed to create bcache with %d cache blocks.", 
cache_blocks);
+               log_error("Failed to set up io layer with %d blocks.", 
cache_blocks);
                return 0;
        }
 
@@ -1292,7 +1292,7 @@ int label_scan(struct cmd_context *cmd)
         * data to invalidate.)
         */
        if (!(iter = dev_iter_create(NULL, 0))) {
-               log_error("Scanning failed to get devices.");
+               log_error("Failed to get device list.");
                return 0;
        }
        while ((dev = dev_iter_get(cmd, iter))) {
diff --git a/test/shell/devicesfile-basic.sh b/test/shell/devicesfile-basic.sh
index 77fe265a0c54..715c579b394c 100644
--- a/test/shell/devicesfile-basic.sh
+++ b/test/shell/devicesfile-basic.sh
@@ -107,6 +107,7 @@ not vgs --devicesfile test.devices $vg2
 # misspelled override name fails
 not vgs --devicesfile doesnotexist $vg1
 not vgs --devicesfile doesnotexist $vg2
+not vgs --devicesfile doesnotexist
 
 # devicesfile and devices cannot be used together
 not vgs --devicesfile test.devices --devices "$dev1","$dev1" $vg1
diff --git a/tools/pvcreate.c b/tools/pvcreate.c
index 71eb060a37ae..a1ef0e9e1941 100644
--- a/tools/pvcreate.c
+++ b/tools/pvcreate.c
@@ -144,7 +144,8 @@ int pvcreate(struct cmd_context *cmd, int argc, char **argv)
 
        cmd->create_edit_devices_file = 1;
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_ECMD_FAILED;
 
        if (!(handle = init_processing_handle(cmd, NULL))) {
                log_error("Failed to initialize processing handle.");
diff --git a/tools/pvremove.c b/tools/pvremove.c
index 2dfdbd016826..5c39ee0c7904 100644
--- a/tools/pvremove.c
+++ b/tools/pvremove.c
@@ -45,7 +45,8 @@ int pvremove(struct cmd_context *cmd, int argc, char **argv)
 
        clear_hint_file(cmd);
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_ECMD_FAILED;
 
        /* When forcibly clearing a PV we don't care about a VG lock. */
        if (pp.force == DONT_PROMPT_OVERRIDE)
diff --git a/tools/pvscan.c b/tools/pvscan.c
index 1e47d754ab7e..72c3279c3179 100644
--- a/tools/pvscan.c
+++ b/tools/pvscan.c
@@ -1407,7 +1407,8 @@ static int _pvscan_cache_all(struct cmd_context *cmd, int 
argc, char **argv,
         * which we want 'pvscan --cache' to do, and that uses
         * info from lvmcache, e.g. duplicate pv info.
         */
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_0;
 
        cmd->pvscan_recreate_hints = 0;
        cmd->use_hints = 0;
diff --git a/tools/toollib.c b/tools/toollib.c
index d77092d894d2..544791808f6c 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -1655,7 +1655,10 @@ int process_each_label(struct cmd_context *cmd, int 
argc, char **argv,
 
        log_set_report_object_type(LOG_REPORT_OBJECT_TYPE_LABEL);
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd)) {
+               ret_max = ECMD_FAILED;
+               goto_out;
+       }
 
        if (argc) {
                for (; opt < argc; opt++) {
@@ -2435,8 +2438,13 @@ int process_each_vg(struct cmd_context *cmd,
         * Scan all devices to populate lvmcache with initial
         * list of PVs and VGs.
         */
-       if (!(read_flags & PROCESS_SKIP_SCAN))
-               lvmcache_label_scan(cmd);
+       if (!(read_flags & PROCESS_SKIP_SCAN)) {
+               if (!lvmcache_label_scan(cmd)) {
+                       ret_max = ECMD_FAILED;
+                       goto_out;
+               }
+       }
+
 
        /*
         * A list of all VGs on the system is needed when:
@@ -3987,7 +3995,10 @@ int process_each_lv(struct cmd_context *cmd,
         * Scan all devices to populate lvmcache with initial
         * list of PVs and VGs.
         */
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd)) {
+               ret_max = ECMD_FAILED;
+               goto_out;
+       }
 
        /*
         * A list of all VGs on the system is needed when:
@@ -4623,8 +4634,12 @@ int process_each_pv(struct cmd_context *cmd,
                goto_out;
        }
 
-       if (!(read_flags & PROCESS_SKIP_SCAN))
-               lvmcache_label_scan(cmd);
+       if (!(read_flags & PROCESS_SKIP_SCAN)) {
+               if (!lvmcache_label_scan(cmd)) {
+                       ret_max = ECMD_FAILED;
+                       goto_out;
+               }
+       }
 
        if (!lvmcache_get_vgnameids(cmd, &all_vgnameids, only_this_vgname, 1)) {
                ret_max = ret;
diff --git a/tools/vgcfgrestore.c b/tools/vgcfgrestore.c
index e49313d144e8..9fcba89d44d5 100644
--- a/tools/vgcfgrestore.c
+++ b/tools/vgcfgrestore.c
@@ -132,7 +132,10 @@ int vgcfgrestore(struct cmd_context *cmd, int argc, char 
**argv)
 
        clear_hint_file(cmd);
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd)) {
+               unlock_vg(cmd, NULL, vg_name);
+               return_ECMD_FAILED;
+       }
 
        cmd->handles_unknown_segments = 1;
 
diff --git a/tools/vgcreate.c b/tools/vgcreate.c
index dde3f1eac279..14608777fd59 100644
--- a/tools/vgcreate.c
+++ b/tools/vgcreate.c
@@ -84,7 +84,10 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv)
 
        cmd->create_edit_devices_file = 1;
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd)) {
+               unlock_vg(cmd, NULL, vp_new.vg_name);
+               return_ECMD_FAILED;
+       }
 
        if (lvmcache_vginfo_from_vgname(vp_new.vg_name, NULL)) {
                unlock_vg(cmd, NULL, vp_new.vg_name);
diff --git a/tools/vgextend.c b/tools/vgextend.c
index 0856b4c78d25..fecd6bdd5b4f 100644
--- a/tools/vgextend.c
+++ b/tools/vgextend.c
@@ -160,7 +160,8 @@ int vgextend(struct cmd_context *cmd, int argc, char **argv)
 
        cmd->edit_devices_file = 1;
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_ECMD_FAILED;
 
        if (!(handle = init_processing_handle(cmd, NULL))) {
                log_error("Failed to initialize processing handle.");
diff --git a/tools/vgmerge.c b/tools/vgmerge.c
index 08615cd62305..4ed4a8f0b752 100644
--- a/tools/vgmerge.c
+++ b/tools/vgmerge.c
@@ -72,7 +72,8 @@ static int _vgmerge_single(struct cmd_context *cmd, const 
char *vg_name_to,
                return ECMD_FAILED;
        }
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_ECMD_FAILED;
 
        if (strcmp(vg_name_to, vg_name_from) > 0)
                lock_vg_from_first = 1;
diff --git a/tools/vgsplit.c b/tools/vgsplit.c
index 5f113b3635e2..c7f4b8af4db1 100644
--- a/tools/vgsplit.c
+++ b/tools/vgsplit.c
@@ -559,7 +559,8 @@ int vgsplit(struct cmd_context *cmd, int argc, char **argv)
                return ECMD_FAILED;
        }
 
-       lvmcache_label_scan(cmd);
+       if (!lvmcache_label_scan(cmd))
+               return_ECMD_FAILED;
 
        if (!(vginfo_to = lvmcache_vginfo_from_vgname(vg_name_to, NULL))) {
                if (!validate_name(vg_name_to)) {
-- 
2.26.2


++++++ 0007-report-fix-pe_start-column-type-from-NUM-to-SIZ.patch ++++++
>From fc8fda641781d0978ff22ad0a59d5a19b5e450e1 Mon Sep 17 00:00:00 2001
From: Peter Rajnoha <prajn...@redhat.com>
Date: Fri, 5 Aug 2022 11:02:25 +0200
Subject: [PATCH] report: fix pe_start column type from NUM to SIZ

The 'pe_start' column was incorrectly marked as being of type NUM.
This was not correct as pe_start is actually of type SIZ, which means
it can have a size suffix and hence it's not a pure numeric value.

Proper column type is important for selection to work correctly, so we
can also do comparisons while using suffixes.

This is also important for new "json_std" output format which does not
put double quotes around pure numeric values. With pe_start incorrectly
marked as NUM instead of SIZ, this produced invalid JSON output
like '"pe_start" = 1.00m' because it contained the 'm' (or other)
size suffix. If properly marked as SIZ, this is then put in double
quotes like '"pe_start" = "1.00m"'.
---
 lib/report/columns.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/report/columns.h b/lib/report/columns.h
index 7e450dacef66..d702635d2f15 100644
--- a/lib/report/columns.h
+++ b/lib/report/columns.h
@@ -191,7 +191,7 @@ FIELD(LABEL, label, NUM, "PExtVsn", type, 0, pvextvsn, 
pv_ext_vsn, "PV header ex
 /*
  * PVS type fields
  */
-FIELD(PVS, pv, NUM, "1st PE", pe_start, 7, size64, pe_start, "Offset to the 
start of data on the underlying device.", 0)
+FIELD(PVS, pv, SIZ, "1st PE", pe_start, 7, size64, pe_start, "Offset to the 
start of data on the underlying device.", 0)
 FIELD(PVS, pv, SIZ, "PSize", id, 0, pvsize, pv_size, "Size of PV in current 
units.", 0)
 FIELD(PVS, pv, SIZ, "PFree", id, 0, pvfree, pv_free, "Total amount of 
unallocated space in current units.", 0)
 FIELD(PVS, pv, SIZ, "Used", id, 0, pvused, pv_used, "Total amount of allocated 
space in current units.", 0)
-- 
2.26.2


++++++ 0008-_vg_read_raw_area-fix-segfault-caused-by-using-null-.patch ++++++
>From ce58e9d5b37c3e408f2b41c8095980490a87f2a4 Mon Sep 17 00:00:00 2001
From: Wu Guanghao <wuguangh...@huawei.com>
Date: Mon, 15 Aug 2022 09:39:02 -0500
Subject: [PATCH] _vg_read_raw_area: fix segfault caused by using null pointer

When we tested lvm2, the kernel injected various random faults.

(gdb) bt
...
(gdb) p vg
$1 = (struct volume_group *) 0x0
(gdb) p use_previous_vg
$2 = (unsigned int *) 0x0

Signed-off-by: Wu Guanghao <wuguangh...@huawei.com>
---
 lib/format_text/format-text.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c
index 07aaa0b28880..c1ccdb0316d8 100644
--- a/lib/format_text/format-text.c
+++ b/lib/format_text/format-text.c
@@ -428,7 +428,7 @@ static struct volume_group *_vg_read_raw_area(struct 
cmd_context *cmd,
                                rlocn->checksum,
                                &when, &desc);
 
-       if (!vg && !*use_previous_vg) {
+       if (!vg && (!use_previous_vg || !*use_previous_vg)) {
                log_warn("WARNING: Failed to read metadata text at %llu off 
%llu size %llu VG %s on %s",
                         (unsigned long long)(area->start + rlocn->offset),
                         (unsigned long long)rlocn->offset,
-- 
2.26.2


++++++ 0009-mm-remove-libaio-from-being-skipped.patch ++++++
>From a3eb6ba425773224076c41aabc3c490a6a016ee6 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabe...@redhat.com>
Date: Thu, 18 Aug 2022 14:31:27 +0200
Subject: [PATCH] mm: remove libaio from being skipped

Since libaio is now used also in critical section,
keep the libaio locked in memory.
---
 lib/mm/memlock.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/lib/mm/memlock.c b/lib/mm/memlock.c
index 3d1a3927ceb4..f43bacdcdf27 100644
--- a/lib/mm/memlock.c
+++ b/lib/mm/memlock.c
@@ -105,7 +105,6 @@ static const char * const _blacklist_maps[] = {
        "/LC_MESSAGES/",
        "gconv/gconv-modules.cache",
        "/ld-2.",               /* not using dlopen,dlsym during mlock */
-       "/libaio.so.",          /* not using aio during mlock */
        "/libattr.so.",         /* not using during mlock (udev) */
        "/libblkid.so.",        /* not using blkid during mlock (udev) */
        "/libbz2.so.",          /* not using during mlock (udev) */
-- 
2.26.2


++++++ 0010-dmsetup-check-also-for-ouf-of-range-value.patch ++++++
>From 718e38d5faf3a3ca23690d2f4203df1df65eba77 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabe...@redhat.com>
Date: Thu, 18 Aug 2022 13:56:03 +0200
Subject: [PATCH] dmsetup: check also for ouf of range value

Check errno result from strtoull().
---
 libdm/dm-tools/dmsetup.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/libdm/dm-tools/dmsetup.c b/libdm/dm-tools/dmsetup.c
index 8502d9adc170..42eeead68f4d 100644
--- a/libdm/dm-tools/dmsetup.c
+++ b/libdm/dm-tools/dmsetup.c
@@ -5106,8 +5106,9 @@ static int _size_from_string(char *argptr, uint64_t 
*size, const char *name)
        if (!argptr)
                return_0;
 
+       errno = 0;
        *size = strtoull(argptr, &endptr, 10);
-       if (endptr == argptr) {
+       if (errno || endptr == argptr) {
                *size = 0;
                log_error("Invalid %s argument: \"%s\"",
                          name, (*argptr) ? argptr : "");
-- 
2.26.2


++++++ 0011-devices-drop-double-from-sysfs-path.patch ++++++
>From 1a981e9b6efb0bbc0881f5ed1f17900e9c669f48 Mon Sep 17 00:00:00 2001
From: Zdenek Kabelac <zkabe...@redhat.com>
Date: Wed, 10 Aug 2022 15:09:34 +0200
Subject: [PATCH] devices: drop double // from sysfs path

dm_sysfs_dir() comes internally as  /sys/.
---
 lib/device/dev-mpath.c   | 4 ++--
 lib/device/dev-type.c    | 8 ++++----
 lib/metadata/vdo_manip.c | 2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/lib/device/dev-mpath.c b/lib/device/dev-mpath.c
index 27b0f41a6a8a..2040edac3bb8 100644
--- a/lib/device/dev-mpath.c
+++ b/lib/device/dev-mpath.c
@@ -815,7 +815,7 @@ const char *dev_mpath_component_wwid(struct cmd_context 
*cmd, struct device *dev
 
        /* /sys/dev/block/253:7/slaves/sda/device/wwid */
 
-       if (dm_snprintf(slaves_path, sizeof(slaves_path), 
"%s/dev/block/%d:%d/slaves",
+       if (dm_snprintf(slaves_path, sizeof(slaves_path), 
"%sdev/block/%d:%d/slaves",
                        dm_sysfs_dir(), (int)MAJOR(dev->dev), 
(int)MINOR(dev->dev)) < 0) {
                log_warn("Sysfs path to check mpath components is too long.");
                return NULL;
@@ -845,7 +845,7 @@ const char *dev_mpath_component_wwid(struct cmd_context 
*cmd, struct device *dev
 
                /* read /sys/block/sda/device/wwid */
 
-               if (dm_snprintf(wwid_path, sizeof(wwid_path), 
"%s/block/%s/device/wwid",
+               if (dm_snprintf(wwid_path, sizeof(wwid_path), 
"%sblock/%s/device/wwid",
                                        dm_sysfs_dir(), slave_name) < 0) {
                        log_warn("Failed to create sysfs wwid path for %s", 
slave_name);
                        continue;
diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c
index 939eb4aeb514..1dc895b54216 100644
--- a/lib/device/dev-type.c
+++ b/lib/device/dev-type.c
@@ -548,7 +548,7 @@ static int _has_sys_partition(struct device *dev)
        int minor = (int) MINOR(dev->dev);
 
        /* check if dev is a partition */
-       if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d/partition",
+       if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d/partition",
                        dm_sysfs_dir(), major, minor) < 0) {
                log_warn("WARNING: %s: partition path is too long.", 
dev_name(dev));
                return 0;
@@ -775,7 +775,7 @@ int dev_get_primary_dev(struct dev_types *dt, struct device 
*dev, dev_t *result)
         * - basename ../../block/md0/md0  = md0
         * Parent's 'dev' sysfs attribute  = /sys/block/md0/dev
         */
-       if (dm_snprintf(path, sizeof(path), "%s/dev/block/%d:%d",
+       if (dm_snprintf(path, sizeof(path), "%sdev/block/%d:%d",
                        dm_sysfs_dir(), major, minor) < 0) {
                log_warn("WARNING: %s: major:minor sysfs path is too long.", 
dev_name(dev));
                return 0;
@@ -787,7 +787,7 @@ int dev_get_primary_dev(struct dev_types *dt, struct device 
*dev, dev_t *result)
 
        temp_path[size] = '\0';
 
-       if (dm_snprintf(path, sizeof(path), "%s/block/%s/dev",
+       if (dm_snprintf(path, sizeof(path), "%sblock/%s/dev",
                        dm_sysfs_dir(), basename(dirname(temp_path))) < 0) {
                log_warn("WARNING: sysfs path for %s is too long.",
                         basename(dirname(temp_path)));
@@ -1095,7 +1095,7 @@ int wipe_known_signatures(struct cmd_context *cmd, struct 
device *dev,
 static int _snprintf_attr(char *buf, size_t buf_size, const char *sysfs_dir,
                         const char *attribute, dev_t dev)
 {
-       if (dm_snprintf(buf, buf_size, "%s/dev/block/%d:%d/%s", sysfs_dir,
+       if (dm_snprintf(buf, buf_size, "%sdev/block/%d:%d/%s", sysfs_dir,
                        (int)MAJOR(dev), (int)MINOR(dev),
                        attribute) < 0) {
                log_warn("WARNING: sysfs path for %s attribute is too long.", 
attribute);
diff --git a/lib/metadata/vdo_manip.c b/lib/metadata/vdo_manip.c
index 0db401537d7c..779883d03bc3 100644
--- a/lib/metadata/vdo_manip.c
+++ b/lib/metadata/vdo_manip.c
@@ -148,7 +148,7 @@ static int _sysfs_get_kvdo_value(const char *dm_name, const 
struct dm_info *dmin
        char temp[64];
        int fd, size, r = 0;
 
-       if (dm_snprintf(path, sizeof(path), "%s/block/dm-%d/vdo/%s",
+       if (dm_snprintf(path, sizeof(path), "%sblock/dm-%d/vdo/%s",
                        dm_sysfs_dir(), dminfo->minor, vdo_param) < 0) {
                log_debug("Failed to build kvdo path.");
                return 0;
-- 
2.26.2


++++++ 0012-devices-file-fix-pvcreate-uuid-matching-pvid-entry-w.patch ++++++
>From 8c3cfc75c72696ae8b620555fcc4f815b0c1d6b6 Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Fri, 19 Aug 2022 13:31:22 -0500
Subject: [PATCH] devices file: fix pvcreate --uuid matching pvid entry with no
 device id

pvcreate with --uuid would segfault if a devices file entry matched
the specified pvid, but the devices file entry had no device_id, which
could happen if the entry has a devname idtype.
---
 lib/device/device_id.c            |  7 ++++---
 test/shell/devicesfile-devname.sh | 13 +++++++++++++
 2 files changed, 17 insertions(+), 3 deletions(-)

diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 9dec9f884da4..6c70f110c820 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -1168,8 +1168,9 @@ id_done:
                          du_devname->devname);
 
        if (du_pvid && (du_pvid->dev != dev))
-               log_warn("WARNING: adding device %s with PVID %s which is 
already used for %s.",
-                        dev_name(dev), pvid, du_pvid->dev ? 
dev_name(du_pvid->dev) : "missing device");
+               log_warn("WARNING: adding device %s with PVID %s which is 
already used for %s device_id %s.",
+                        dev_name(dev), pvid, du_pvid->dev ? 
dev_name(du_pvid->dev) : "missing device",
+                        du_pvid->idname ?: "none");
 
        if (du_devid && (du_devid->dev != dev)) {
                if (!du_devid->dev) {
@@ -1215,7 +1216,7 @@ id_done:
                else
                        check_idname = device_id_system_read(cmd, dev, 
du_pvid->idtype);
 
-               if (check_idname && !strcmp(check_idname, du_pvid->idname)) {
+               if (!du_pvid->idname || (check_idname && !strcmp(check_idname, 
du_pvid->idname))) {
                        update_du = du_pvid;
                        dm_list_del(&update_du->list);
                        update_matching_kind = "PVID";
diff --git a/test/shell/devicesfile-devname.sh 
b/test/shell/devicesfile-devname.sh
index 338637275ec5..211f4dbed36b 100644
--- a/test/shell/devicesfile-devname.sh
+++ b/test/shell/devicesfile-devname.sh
@@ -550,6 +550,19 @@ vgchange -an $vg2
 vgremove -ff $vg1
 vgremove -ff $vg2
 
+# bz 2119473
+
+aux lvmconf "devices/search_for_devnames = \"none\""
+sed -e "s|DEVNAME=$dev1|DEVNAME=.|" "$ORIG" > tmp1.devices
+sed -e "s|IDNAME=$dev1|IDNAME=.|" tmp1.devices > "$DF"
+pvs
+lvmdevices
+pvcreate -ff --yes --uuid "$PVID1" --norestorefile $dev1
+grep "$PVID1" "$DF" |tee out
+grep "DEVNAME=$dev1" out
+grep "IDNAME=$dev1" out
+aux lvmconf "devices/search_for_devnames = \"auto\""
+
 # devnames change so the new devname now refers to a filtered device,
 # e.g. an mpath or md component, which is not scanned
 
-- 
2.26.2


++++++ 0013-vgimportdevices-change-result-when-devices-are-not-a.patch ++++++
>From 3c49a2e43ccfbad720a3134484c7870a14b1135b Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Mon, 29 Aug 2022 15:17:36 -0500
Subject: [PATCH] vgimportdevices: change result when devices are not added

When using --all, if one VG is skipped, continue adding
other VGs, and do not return an error from the command
if some VGs are added. (A VG is skipped if it's missing PVs.)

If the command fails during devices file setup or device
scanning, then remove the devices file if it has been
newly created by the command, and exit with an error.

If devices from a named VG are not imported (e.g. the
VG is missing devices), then remove the devices file if
it has been newly created by the command, and exit with
an error.

If --all VGs are being imported, and no devices are found
to include in the devices file, then remove the devices
file if it has been newly created by the command, and
exit with an error.
---
 test/shell/vgimportdevices.sh | 308 ++++++++++++++++++++++++++++++++++
 tools/vgimportdevices.c       |  41 +++--
 2 files changed, 336 insertions(+), 13 deletions(-)
 create mode 100644 test/shell/vgimportdevices.sh

diff --git a/test/shell/vgimportdevices.sh b/test/shell/vgimportdevices.sh
new file mode 100644
index 000000000000..47363cec350a
--- /dev/null
+++ b/test/shell/vgimportdevices.sh
@@ -0,0 +1,308 @@
+
+#!/usr/bin/env bash
+
+# Copyright (C) 2020 Red Hat, Inc. All rights reserved.
+#
+# This copyrighted material is made available to anyone wishing to use,
+# modify, copy, or redistribute it subject to the terms and conditions
+# of the GNU General Public License v.2.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software Foundation,
+# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+test_description='vgimportdevices'
+
+. lib/inittest
+
+aux prepare_devs 5
+
+DFDIR="$LVM_SYSTEM_DIR/devices"
+mkdir "$DFDIR" || true
+DF="$DFDIR/system.devices"
+
+aux lvmconf 'devices/use_devicesfile = 1'
+
+not ls "$DF"
+pvcreate "$dev1"
+ls "$DF"
+grep "$dev1" "$DF"
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+
+#
+# vgimportdevices -a with no prev df
+#
+
+# no devs found
+not vgimportdevices -a
+not ls "$DF"
+
+# one orphan pv, no vgs
+pvcreate "$dev1"
+rm -f "$DF"
+not vgimportdevices -a
+not ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1" "$dev2"
+lvcreate -l1 -an $vg1
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices -a
+not ls "$DF"
+vgs $vg1
+pvs "$dev2"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# three complete, one incomplete vg
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+vgcreate $vg3 "$dev3"
+vgcreate $vg4 "$dev4" "$dev5"
+rm -f "$DF"
+dd if=/dev/zero of="$dev5" bs=1M count=1
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+grep "$dev3" "$DF"
+not grep "$dev4" "$DF"
+not grep "$dev5" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
+
+#
+# vgimportdevices -a with existing df
+#
+
+# no devs found
+vgcreate $vg1 "$dev1"
+grep "$dev1" "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices -a
+ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2"
+not grep "$dev2" "$DF"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate --devicesfile "" $vg1 "$dev1"
+vgcreate --devicesfile "" $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+vgcreate --devicesfile "" $vg2 "$dev2" "$dev3"
+not grep "$dev2" "$DF"
+not grep "$dev3" "$DF"
+dd if=/dev/zero of="$dev2" bs=1M count=1
+not vgimportdevices -a
+ls "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+rm -f "$DF"
+
+# import the same vg again
+vgcreate --devicesfile "" $vg1 "$dev1"
+not ls "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+vgimportdevices -a
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# import a series of vgs
+vgcreate --devicesfile "" $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+vgcreate --devicesfile "" $vg3 "$dev3"
+vgimportdevices -a
+grep "$dev1" "$DF"
+grep "$dev2" "$DF"
+grep "$dev3" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+rm -f "$DF"
+
+#
+# vgimportdevices vg with no prev df
+#
+
+# no devs found
+not vgimportdevices $vg1
+not ls "$DF"
+
+# one complete vg
+vgcreate $vg1 "$dev1"
+rm -f "$DF"
+vgimportdevices $vg1
+ls "$DF"
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# two complete vgs
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+rm -f "$DF"
+vgimportdevices $vg1
+ls "$DF"
+grep "$dev1" "$DF"
+vgimportdevices $vg2
+ls "$DF"
+grep "$dev2" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# one incomplete vg
+vgcreate $vg1 "$dev1" "$dev2"
+lvcreate -l1 -an $vg1
+rm -f "$DF"
+dd if=/dev/zero of="$dev1" bs=1M count=1
+not vgimportdevices $vg1
+not ls "$DF"
+vgs $vg1
+pvs "$dev2"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+rm -f "$DF"
+
+# three complete, one incomplete vg
+vgcreate $vg1 "$dev1"
+vgcreate $vg2 "$dev2"
+vgcreate $vg3 "$dev3"
+vgcreate $vg4 "$dev4" "$dev5"
+rm -f "$DF"
+dd if=/dev/zero of="$dev5" bs=1M count=1
+not vgimportdevices $vg4
+not ls "$DF"
+vgimportdevices $vg3
+ls "$DF"
+grep "$dev3" "$DF"
+not grep "$dev1" "$DF"
+not grep "$dev2" "$DF"
+not grep "$dev4" "$DF"
+not grep "$dev5" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
+#
+# vgimportdevices vg with existing df
+#
+
+# vg not found
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+not vgimportdevices $vg2
+grep "$dev1" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+rm -f "$DF"
+
+# vg incomplete
+vgcreate $vg1 "$dev1"
+vgimportdevices -a
+grep "$dev1" "$DF"
+vgcreate --devicesfile "" $vg2 "$dev2" "$dev3"
+dd if=/dev/zero of="$dev2" bs=1M count=1
+not vgimportdevices $vg2
+grep "$dev1" "$DF"
+not grep "$dev2" "$DF"
+not grep "$dev3" "$DF"
+
+# reset
+dd if=/dev/zero of="$dev1" bs=1M count=1
+dd if=/dev/zero of="$dev2" bs=1M count=1
+dd if=/dev/zero of="$dev3" bs=1M count=1
+dd if=/dev/zero of="$dev4" bs=1M count=1
+rm -f "$DF"
+
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index ea205d941073..9ade1b9e4b21 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -36,9 +36,9 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
        dm_list_iterate_items(pvl, &vg->pvs) {
                if (is_missing_pv(pvl->pv) || !pvl->pv->dev) {
                        memcpy(pvid, &pvl->pv->id.uuid, ID_LEN);
-                       log_error("Not importing devices for VG %s with missing 
PV %s.",
-                                vg->name, pvid);
-                       goto bad;
+                       log_print("Not importing devices for VG %s with missing 
PV %s.",
+                                 vg->name, pvid);
+                       return ECMD_PROCESSED;
                }
        }
 
@@ -71,14 +71,17 @@ static int _vgimportdevices_single(struct cmd_context *cmd,
                updated_pvs++;
        }
 
+       /*
+        * Writes the device_id of each PV into the vg metadata.
+        * This is not a critial step and should not influence
+        * the result of the command.
+        */
        if (updated_pvs) {
                if (!vg_write(vg) || !vg_commit(vg))
-                       goto_bad;
+                       log_print("Failed to write device ids in VG metadata.");
        }
 
        return ECMD_PROCESSED;
-bad:
-       return ECMD_FAILED;
 }
 
 /*
@@ -114,6 +117,7 @@ int vgimportdevices(struct cmd_context *cmd, int argc, char 
**argv)
 {
        struct vgimportdevices_params vp = { 0 };
        struct processing_handle *handle;
+       int created_file = 0;
        int ret = ECMD_FAILED;
 
        if (arg_is_set(cmd, foreign_ARG))
@@ -139,9 +143,12 @@ int vgimportdevices(struct cmd_context *cmd, int argc, 
char **argv)
                log_error("Devices file not enabled.");
                return ECMD_FAILED;
        }
-       if (!devices_file_exists(cmd) && !devices_file_touch(cmd)) {
-               log_error("Failed to create devices file.");
-               return ECMD_FAILED;
+       if (!devices_file_exists(cmd)) {
+               if (!devices_file_touch(cmd)) {
+                       log_error("Failed to create devices file.");
+                       return ECMD_FAILED;
+               }
+               created_file = 1;
        }
 
        /*
@@ -195,22 +202,30 @@ int vgimportdevices(struct cmd_context *cmd, int argc, 
char **argv)
         */
        ret = process_each_vg(cmd, argc, argv, NULL, NULL, READ_FOR_UPDATE,
                              0, handle, _vgimportdevices_single);
-       if (ret == ECMD_FAILED)
-               goto out;
+       if (ret == ECMD_FAILED) {
+               /*
+                * Error from setting up devices file or label_scan,
+                * _vgimportdevices_single does not return an error.
+                */
+               goto_out;
+       }
 
        if (!vp.added_devices) {
-               log_print("No devices to add.");
+               log_error("No devices to add.");
+               ret = ECMD_FAILED;
                goto out;
        }
 
        if (!device_ids_write(cmd)) {
-               log_print("Failed to update devices file.");
+               log_error("Failed to write the devices file.");
                ret = ECMD_FAILED;
                goto out;
        }
 
        log_print("Added %u devices to devices file.", vp.added_devices);
 out:
+       if ((ret == ECMD_FAILED) && created_file)
+               unlink(cmd->devices_file_path);
        destroy_processing_handle(cmd, handle);
        return ret;
 }
-- 
2.26.2


++++++ 0014-vgimportdevices-fix-locking-when-creating-devices-fi.patch ++++++
>From 0eebd9d7802c724ee71b6ebb80940ea6007f9c7a Mon Sep 17 00:00:00 2001
From: David Teigland <teigl...@redhat.com>
Date: Tue, 30 Aug 2022 14:40:48 -0500
Subject: [PATCH] vgimportdevices: fix locking when creating devices file

Take the devices file lock before creating a new devices file.
(Was missed by the change to preemptively create the devices
file prior to setup_devices(), which was done to improve the
error path.)
---
 lib/device/dev-cache.c  |  7 +++----
 lib/device/device_id.c  |  1 +
 tools/vgimportdevices.c | 10 ++++++++--
 3 files changed, 12 insertions(+), 6 deletions(-)

diff --git a/lib/device/dev-cache.c b/lib/device/dev-cache.c
index 193eb7585f45..85f9b499af4d 100644
--- a/lib/device/dev-cache.c
+++ b/lib/device/dev-cache.c
@@ -1937,10 +1937,9 @@ int setup_devices(struct cmd_context *cmd)
 
        if (!file_exists) {
                /*
-                * pvcreate/vgcreate/vgimportdevices/lvmdevices-add create
-                * a new devices file here if it doesn't exist.
-                * They have the create_edit_devices_file flag set.
-                * First they create/lock-ex the devices file lockfile.
+                * pvcreate/vgcreate create a new devices file here if it
+                * doesn't exist.  They have create_edit_devices_file=1.
+                * First create/lock-ex the devices file lockfile.
                 * Other commands will not use a devices file if none exists.
                 */
                lock_mode = LOCK_EX;
diff --git a/lib/device/device_id.c b/lib/device/device_id.c
index 6c70f110c820..a0a6265336ed 100644
--- a/lib/device/device_id.c
+++ b/lib/device/device_id.c
@@ -2468,6 +2468,7 @@ static int _lock_devices_file(struct cmd_context *cmd, 
int mode, int nonblock, i
 
        if (_devices_file_locked == mode) {
                /* can happen when a command holds an ex lock and does an 
update in device_ids_validate */
+               /* can happen when vgimportdevices calls this directly, 
followed later by setup_devices */
                if (held)
                        *held = 1;
                return 1;
diff --git a/tools/vgimportdevices.c b/tools/vgimportdevices.c
index 9ade1b9e4b21..23c2718ffe0f 100644
--- a/tools/vgimportdevices.c
+++ b/tools/vgimportdevices.c
@@ -132,8 +132,10 @@ int vgimportdevices(struct cmd_context *cmd, int argc, 
char **argv)
                return ECMD_FAILED;
 
        /*
-        * Prepare devices file preemptively because the error path for this
-        * case from process_each is not as clean.
+        * Prepare/create devices file preemptively because the error path for
+        * this case from process_each/setup_devices is not as clean.
+        * This means that when setup_devices is called, it the devices
+        * file steps will be redundant, and need to handle being repeated.
         */
        if (!setup_devices_file(cmd)) {
                log_error("Failed to set up devices file.");
@@ -143,6 +145,10 @@ int vgimportdevices(struct cmd_context *cmd, int argc, 
char **argv)
                log_error("Devices file not enabled.");
                return ECMD_FAILED;
        }
+       if (!lock_devices_file(cmd, LOCK_EX)) {
+               log_error("Failed to lock the devices file.");
+               return ECMD_FAILED;
+       }
        if (!devices_file_exists(cmd)) {
                if (!devices_file_touch(cmd)) {
                        log_error("Failed to create devices file.");
-- 
2.26.2


++++++ LVM2.2.03.15.tgz -> LVM2.2.03.16.tgz ++++++
++++ 5388 lines of diff (skipped)

++++++ bug-1184687_Add-nolvm-for-kernel-cmdline.patch ++++++
--- /var/tmp/diff_new_pack.r4SqXY/_old  2022-09-06 13:00:55.502950610 +0200
+++ /var/tmp/diff_new_pack.r4SqXY/_new  2022-09-06 13:00:55.506950620 +0200
@@ -12,14 +12,10 @@
 
 Signed-off-by: Heming Zhao <heming.z...@suse.com>
 ---
- scripts/lvm2-pvscan.service.in | 1 +
- udev/69-dm-lvm-metad.rules.in  | 3 +++
- 2 files changed, 4 insertions(+)
 
-diff --git a/scripts/lvm2-pvscan.service.in b/scripts/lvm2-pvscan.service.in
-index 09753e8c9ef1..1977e4e215fb 100644
---- a/scripts/lvm2-pvscan.service.in
-+++ b/scripts/lvm2-pvscan.service.in
+diff -Nupr a/scripts/lvm2-pvscan.service.in b/scripts/lvm2-pvscan.service.in
+--- a/scripts/lvm2-pvscan.service.in   2022-09-02 14:05:03.706825230 +0800
++++ b/scripts/lvm2-pvscan.service.in   2022-09-02 14:04:09.115063287 +0800
 @@ -7,6 +7,7 @@ BindsTo=dev-block-%i.device
  After=multipathd.service
  Before=shutdown.target
@@ -28,11 +24,10 @@
  
  [Service]
  Type=oneshot
-diff --git a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
-index 78f506520c45..16e8536e8a2a 100644
---- a/udev/69-dm-lvm-metad.rules.in
-+++ b/udev/69-dm-lvm-metad.rules.in
-@@ -19,6 +19,9 @@ SUBSYSTEM!="block", GOTO="lvm_end"
+diff -Nupr a/udev/69-dm-lvm-metad.rules.in b/udev/69-dm-lvm-metad.rules.in
+--- a/udev/69-dm-lvm-metad.rules.in    2022-09-02 14:04:42.618917180 +0800
++++ b/udev/69-dm-lvm-metad.rules.in    2022-09-02 14:03:39.707191529 +0800
+@@ -12,6 +12,9 @@ SUBSYSTEM!="block", GOTO="lvm_end"
  
  ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end"
  
@@ -42,7 +37,17 @@
  # Detect removed PV label by comparing previous ID_FS_TYPE value with current 
one.
  ENV{.ID_FS_TYPE_NEW}="$env{ID_FS_TYPE}"
  IMPORT{db}="ID_FS_TYPE"
--- 
-1.8.3.1
-
+diff -Nupr a/udev/69-dm-lvm.rules.in b/udev/69-dm-lvm.rules.in
+--- a/udev/69-dm-lvm.rules.in  2022-09-02 14:04:51.074880312 +0800
++++ b/udev/69-dm-lvm.rules.in  2022-09-02 14:07:19.978230990 +0800
+@@ -10,6 +10,9 @@ SUBSYSTEM!="block", GOTO="lvm_end"
+ 
+ ENV{DM_UDEV_DISABLE_OTHER_RULES_FLAG}=="1", GOTO="lvm_end"
+ 
++IMPORT{cmdline}="nolvm"
++ENV{nolvm}=="?*", GOTO="lvm_end"
++
+ # Only process devices already marked as a PV - this requires blkid to be 
called before.
+ ENV{ID_FS_TYPE}!="LVM2_member", GOTO="lvm_end"
+ ENV{DM_MULTIPATH_DEVICE_PATH}=="1", GOTO="lvm_end"
 

++++++ lvm.conf ++++++
++++ 866 lines (skipped)
++++ between /work/SRC/openSUSE:Factory/lvm2/lvm.conf
++++ and /work/SRC/openSUSE:Factory/.lvm2.new.2083/lvm.conf

Reply via email to