diff --git a/.gitignore b/.gitignore index bf3cd56..d8b18f0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/LVM2.2.02.180.tgz +SOURCES/LVM2.2.02.185.tgz SOURCES/boom-0.9.tar.gz diff --git a/.lvm2.metadata b/.lvm2.metadata index 498c1a7..5a7c0ae 100644 --- a/.lvm2.metadata +++ b/.lvm2.metadata @@ -1,2 +1,2 @@ -d85f7a9bdfd2de48f0bd7ce4d7698685eff6b68e SOURCES/LVM2.2.02.180.tgz +99fff498b207c8684c6b044f17a9194a049aeab3 SOURCES/LVM2.2.02.185.tgz dd96613e238f342641b5be8977ee8598662e8ab9 SOURCES/boom-0.9.tar.gz diff --git a/SOURCES/lvm2-2_02_180-make-generate.patch b/SOURCES/lvm2-2_02_180-make-generate.patch deleted file mode 100644 index 314425c..0000000 --- a/SOURCES/lvm2-2_02_180-make-generate.patch +++ /dev/null @@ -1,239 +0,0 @@ - conf/example.conf.in | 20 ++++++++++++++++---- - man/pvcreate.8_pregen | 7 ++++--- - man/vgcfgrestore.8_pregen | 9 +++++---- - man/vgconvert.8_pregen | 14 +++++++++----- - man/vgcreate.8_pregen | 7 ++++--- - man/vgextend.8_pregen | 7 ++++--- - man/vgsplit.8_pregen | 7 ++++--- - 7 files changed, 46 insertions(+), 25 deletions(-) - -diff --git a/conf/example.conf.in b/conf/example.conf.in -index cd58615..742812c 100644 ---- a/conf/example.conf.in -+++ b/conf/example.conf.in -@@ -702,17 +702,29 @@ global { - activation = 1 - - # Configuration option global/fallback_to_lvm1. -- # This setting is no longer used. -+ # Try running LVM1 tools if LVM cannot communicate with DM. -+ # This option only applies to 2.4 kernels and is provided to help -+ # switch between device-mapper kernels and LVM1 kernels. The LVM1 -+ # tools need to be installed with .lvm1 suffices, e.g. vgscan.lvm1. -+ # They will stop working once the lvm2 on-disk metadata format is used. - # This configuration option has an automatic default value. -- # fallback_to_lvm1 = 0 -+ # fallback_to_lvm1 = @DEFAULT_FALLBACK_TO_LVM1@ - - # Configuration option global/format. -- # This setting is no longer used. -+ # The default metadata format that commands should use. -+ # The -M 1|2 option overrides this setting. -+ # -+ # Accepted values: -+ # lvm1 -+ # lvm2 -+ # - # This configuration option has an automatic default value. - # format = "lvm2" - - # Configuration option global/format_libraries. -- # This setting is no longer used. -+ # Shared libraries that process different metadata formats. -+ # If support for LVM1 metadata was compiled as a shared library use -+ # format_libraries = "liblvm2format1.so" - # This configuration option does not have a default value defined. - - # Configuration option global/segment_libraries. -diff --git a/man/pvcreate.8_pregen b/man/pvcreate.8_pregen -index c4b03da..abceb82 100644 ---- a/man/pvcreate.8_pregen -+++ b/man/pvcreate.8_pregen -@@ -38,7 +38,7 @@ normally prevent it, e.g. if the PV is already in a VG. - .ad b - .br - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -266,11 +266,12 @@ The size may be rounded. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l -diff --git a/man/vgcfgrestore.8_pregen b/man/vgcfgrestore.8_pregen -index cffd44b..e028103 100644 ---- a/man/vgcfgrestore.8_pregen -+++ b/man/vgcfgrestore.8_pregen -@@ -51,7 +51,7 @@ vgcfgrestore - Restore volume group configuration - .ad b - .br - .ad l -- \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .ad b - .br - .ad l -@@ -141,7 +141,7 @@ Common options for command: - . - .RS 4 - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -280,11 +280,12 @@ Display long help text. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l -diff --git a/man/vgconvert.8_pregen b/man/vgconvert.8_pregen -index 5e7f8a9..6228087 100644 ---- a/man/vgconvert.8_pregen -+++ b/man/vgconvert.8_pregen -@@ -8,9 +8,12 @@ vgconvert - Change volume group metadata format - [ \fIoption_args\fP ] - .br - .SH DESCRIPTION --vgconvert converts VG metadata from one format to another. This command --is no longer used because this version of lvm no longer supports the LVM1 -+vgconvert converts VG metadata from one format to another. The new -+metadata format must be able to fit into the space provided by the old - format. -+ -+Because the LVM1 format should no longer be used, this command is no -+longer needed in general. - .SH USAGE - \fBvgconvert\fP \fIVG\fP ... - .br -@@ -20,7 +23,7 @@ format. - .ad b - .br - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -191,11 +194,12 @@ The size may be rounded. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l -diff --git a/man/vgcreate.8_pregen b/man/vgcreate.8_pregen -index 09bf126..ddad391 100644 ---- a/man/vgcreate.8_pregen -+++ b/man/vgcreate.8_pregen -@@ -33,7 +33,7 @@ devices are also available with vgcreate. - .ad b - .br - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -324,11 +324,12 @@ The size may be rounded. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l -diff --git a/man/vgextend.8_pregen b/man/vgextend.8_pregen -index a6a30e9..ee805a8 100644 ---- a/man/vgextend.8_pregen -+++ b/man/vgextend.8_pregen -@@ -36,7 +36,7 @@ will initialize them. In this case pvcreate options can be used, e.g. - .ad b - .br - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -237,11 +237,12 @@ The size may be rounded. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l -diff --git a/man/vgsplit.8_pregen b/man/vgsplit.8_pregen -index 6c3e6ec..210c266 100644 ---- a/man/vgsplit.8_pregen -+++ b/man/vgsplit.8_pregen -@@ -62,7 +62,7 @@ Common options for command: - .ad b - .br - .ad l --[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] -+[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] - .ad b - .br - .ad l -@@ -230,11 +230,12 @@ and --vgmetadatacopies for improving performance. - .ad b - .HP - .ad l --\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP -+\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP - .br - Specifies the type of on-disk metadata to use. - \fBlvm2\fP (or just \fB2\fP) is the current, standard format. --\fBlvm1\fP (or just \fB1\fP) is no longer used. -+\fBlvm1\fP (or just \fB1\fP) is a historical format that -+can be used for accessing old data. - .ad b - .HP - .ad l diff --git a/SOURCES/lvm2-2_02_181-WHATS_NEW.patch b/SOURCES/lvm2-2_02_181-WHATS_NEW.patch deleted file mode 100644 index ad5b2a0..0000000 --- a/SOURCES/lvm2-2_02_181-WHATS_NEW.patch +++ /dev/null @@ -1,29 +0,0 @@ -From b6608e0f8426ad334a9eb2f6e1c9a1cfced0536e Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Tue, 31 Jul 2018 17:02:47 +0200 -Subject: [PATCH 1/2] Update WHATS_NEW - ---- - WHATS_NEW | 7 +++++-- - 1 file changed, 5 insertions(+), 2 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 3b15325..546d3e6 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,7 +1,10 @@ - Version 2.02.181 - - ================================= -- lvconvert: reject conversions on raid1 LVs with split tracked SubLVs -- lvconvert: reject conversions on raid1 split tracked SubLVs -+ Reject conversions on raid1 LVs with split tracked SubLVs. -+ Reject conversions on raid1 split tracked SubLVs. -+ Fix dmstats list failing when no regions exist. -+ Reject conversions of LVs under snapshot. -+ Limit suggested options on incorrect option for lvconvert subcommand. - - Version 2.02.180 - 19th July 2018 - ================================= --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_181-build-make-generate.patch b/SOURCES/lvm2-2_02_181-build-make-generate.patch deleted file mode 100644 index ea9232e..0000000 --- a/SOURCES/lvm2-2_02_181-build-make-generate.patch +++ /dev/null @@ -1,52 +0,0 @@ -From fc32d2b1b62eb9b75c246efd9c8e514b39f7bd3e Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Tue, 31 Jul 2018 17:36:04 +0200 -Subject: [PATCH] build: make generate - -(cherry picked from commit 12dfd0ed02e003e21072798d17dcec4a80fc466d) ---- - man/lvconvert.8_pregen | 14 +++++++++----- - 1 file changed, 9 insertions(+), 5 deletions(-) - -diff --git a/man/lvconvert.8_pregen b/man/lvconvert.8_pregen -index 91691a3..a47127b 100644 ---- a/man/lvconvert.8_pregen -+++ b/man/lvconvert.8_pregen -@@ -475,7 +475,7 @@ Split images from a raid1 or mirror LV and use them to create a new LV. - .RE - - - --Split images from a raid1 LV and track changes to origin. -+Split images from a raid1 LV and track changes to origin for later merge. - .br - .P - \fBlvconvert\fP \fB--splitmirrors\fP \fINumber\fP \fB--trackchanges\fP \fILV\fP\fI_cache_raid1\fP -@@ -1281,6 +1281,8 @@ Before the separation, the cache is flushed. Also see --uncache. - Splits the specified number of images from a raid1 or mirror LV - and uses them to create a new LV. If --trackchanges is also specified, - changes to the raid1 LV are tracked while the split LV remains detached. -+If --name is specified, then the images are permanently split from the -+original LV and changes are not tracked. - .ad b - .HP - .ad l -@@ -1354,10 +1356,12 @@ The name of a thin pool LV. - .br - Can be used with --splitmirrors on a raid1 LV. This causes - changes to the original raid1 LV to be tracked while the split images --remain detached. This allows the read-only detached image(s) to be --merged efficiently back into the raid1 LV later. Only the regions with --changed data are resynchronized during merge. (This option only applies --when using the raid1 LV type.) -+remain detached. This is a temporary state that allows the read-only -+detached image to be merged efficiently back into the raid1 LV later. -+Only the regions with changed data are resynchronized during merge. -+While a raid1 LV is tracking changes, operations on it are limited to -+merging the split image (see --mergemirrors) or permanently splitting -+the image (see --splitmirrors with --name. - .ad b - .HP - .ad l --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_181-dmeventd-base-vdo-plugin.patch b/SOURCES/lvm2-2_02_181-dmeventd-base-vdo-plugin.patch deleted file mode 100644 index 938c669..0000000 --- a/SOURCES/lvm2-2_02_181-dmeventd-base-vdo-plugin.patch +++ /dev/null @@ -1,562 +0,0 @@ - WHATS_NEW_DM | 1 + - configure | 3 +- - configure.ac | 1 + - daemons/dmeventd/libdevmapper-event.c | 1 + - daemons/dmeventd/plugins/Makefile.in | 9 +- - daemons/dmeventd/plugins/vdo/.exported_symbols | 3 + - daemons/dmeventd/plugins/vdo/Makefile.in | 36 +++ - daemons/dmeventd/plugins/vdo/dmeventd_vdo.c | 406 +++++++++++++++++++++++++ - 8 files changed, 453 insertions(+), 7 deletions(-) - create mode 100644 daemons/dmeventd/plugins/vdo/.exported_symbols - create mode 100644 daemons/dmeventd/plugins/vdo/Makefile.in - create mode 100644 daemons/dmeventd/plugins/vdo/dmeventd_vdo.c - -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index e77352a..c42ee17 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,5 +1,6 @@ - Version 1.02.150 - - ================================= -+ Add vdo plugin for monitoring VDO devices. - - Version 1.02.149 - 19th July 2018 - ================================= -diff --git a/configure b/configure -index 10b49c6..eb7d70b 100755 ---- a/configure -+++ b/configure -@@ -15648,7 +15648,7 @@ _ACEOF - - - ################################################################################ --ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" -+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmeventd/plugins/vdo/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" - - cat >confcache <<\_ACEOF - # This file is a shell script that caches the results of configure -@@ -16356,6 +16356,7 @@ do - "daemons/dmeventd/plugins/mirror/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/mirror/Makefile" ;; - "daemons/dmeventd/plugins/snapshot/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/snapshot/Makefile" ;; - "daemons/dmeventd/plugins/thin/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/thin/Makefile" ;; -+ "daemons/dmeventd/plugins/vdo/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmeventd/plugins/vdo/Makefile" ;; - "daemons/dmfilemapd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/dmfilemapd/Makefile" ;; - "daemons/lvmdbusd/Makefile") CONFIG_FILES="$CONFIG_FILES daemons/lvmdbusd/Makefile" ;; - "daemons/lvmdbusd/lvmdbusd") CONFIG_FILES="$CONFIG_FILES daemons/lvmdbusd/lvmdbusd" ;; -diff --git a/configure.ac b/configure.ac -index 9fa0c76..24bae39 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -2155,6 +2155,7 @@ daemons/dmeventd/plugins/raid/Makefile - daemons/dmeventd/plugins/mirror/Makefile - daemons/dmeventd/plugins/snapshot/Makefile - daemons/dmeventd/plugins/thin/Makefile -+daemons/dmeventd/plugins/vdo/Makefile - daemons/dmfilemapd/Makefile - daemons/lvmdbusd/Makefile - daemons/lvmdbusd/lvmdbusd -diff --git a/daemons/dmeventd/libdevmapper-event.c b/daemons/dmeventd/libdevmapper-event.c -index 9aeb4c5..f9a8a2b 100644 ---- a/daemons/dmeventd/libdevmapper-event.c -+++ b/daemons/dmeventd/libdevmapper-event.c -@@ -645,6 +645,7 @@ int dm_event_register_handler(const struct dm_event_handler *dmevh) - uuid = dm_task_get_uuid(dmt); - - if (!strstr(dmevh->dso, "libdevmapper-event-lvm2thin.so") && -+ !strstr(dmevh->dso, "libdevmapper-event-lvm2vdo.so") && - !strstr(dmevh->dso, "libdevmapper-event-lvm2snapshot.so") && - !strstr(dmevh->dso, "libdevmapper-event-lvm2mirror.so") && - !strstr(dmevh->dso, "libdevmapper-event-lvm2raid.so")) -diff --git a/daemons/dmeventd/plugins/Makefile.in b/daemons/dmeventd/plugins/Makefile.in -index 27edf55..951dd2b 100644 ---- a/daemons/dmeventd/plugins/Makefile.in -+++ b/daemons/dmeventd/plugins/Makefile.in -@@ -1,6 +1,6 @@ - # - # Copyright (C) 2001-2004 Sistina Software, Inc. All rights reserved. --# Copyright (C) 2004-2005, 2011 Red Hat, Inc. All rights reserved. -+# Copyright (C) 2004-2018 Red Hat, Inc. All rights reserved. - # - # This file is part of LVM2. - # -@@ -16,11 +16,7 @@ srcdir = @srcdir@ - top_srcdir = @top_srcdir@ - top_builddir = @top_builddir@ - --SUBDIRS += lvm2 snapshot raid thin mirror -- --ifeq ($(MAKECMDGOALS),distclean) -- SUBDIRS = lvm2 mirror snapshot raid thin --endif -+SUBDIRS += lvm2 snapshot raid thin mirror vdo - - include $(top_builddir)/make.tmpl - -@@ -28,3 +24,4 @@ snapshot: lvm2 - mirror: lvm2 - raid: lvm2 - thin: lvm2 -+vdo: lvm2 -diff --git a/daemons/dmeventd/plugins/vdo/.exported_symbols b/daemons/dmeventd/plugins/vdo/.exported_symbols -new file mode 100644 -index 0000000..b88c705 ---- /dev/null -+++ b/daemons/dmeventd/plugins/vdo/.exported_symbols -@@ -0,0 +1,3 @@ -+process_event -+register_device -+unregister_device -diff --git a/daemons/dmeventd/plugins/vdo/Makefile.in b/daemons/dmeventd/plugins/vdo/Makefile.in -new file mode 100644 -index 0000000..bda738a ---- /dev/null -+++ b/daemons/dmeventd/plugins/vdo/Makefile.in -@@ -0,0 +1,36 @@ -+# -+# Copyright (C) 2018 Red Hat, Inc. All rights reserved. -+# -+# This file is part of LVM2. -+# -+# 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 -+ -+srcdir = @srcdir@ -+top_srcdir = @top_srcdir@ -+top_builddir = @top_builddir@ -+ -+INCLUDES += -I$(top_srcdir)/daemons/dmeventd/plugins/lvm2 -+CLDFLAGS += -L$(top_builddir)/daemons/dmeventd/plugins/lvm2 -+ -+SOURCES = dmeventd_vdo.c -+ -+LIB_NAME = libdevmapper-event-lvm2vdo -+LIB_SHARED = $(LIB_NAME).$(LIB_SUFFIX) -+LIB_VERSION = $(LIB_VERSION_LVM) -+ -+CFLOW_LIST = $(SOURCES) -+CFLOW_LIST_TARGET = $(LIB_NAME).cflow -+ -+include $(top_builddir)/make.tmpl -+ -+LIBS += -ldevmapper-event-lvm2 $(INTERNAL_LIBS) -+ -+install_lvm2: install_dm_plugin -+ -+install: install_lvm2 -diff --git a/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c -new file mode 100644 -index 0000000..d77ca79 ---- /dev/null -+++ b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c -@@ -0,0 +1,406 @@ -+/* -+ * Copyright (C) 2018 Red Hat, Inc. All rights reserved. -+ * -+ * This file is part of LVM2. -+ * -+ * 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 Lesser General Public License v.2.1. -+ * -+ * You should have received a copy of the GNU Lesser 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 -+ */ -+ -+#include "lib/misc/lib.h" -+#include "dmeventd_lvm.h" -+#include "daemons/dmeventd/libdevmapper-event.h" -+#include "device_mapper/vdo/target.h" -+ -+#include -+#include -+ -+/* First warning when VDO pool is 80% full. */ -+#define WARNING_THRESH (DM_PERCENT_1 * 80) -+/* Run a check every 5%. */ -+#define CHECK_STEP (DM_PERCENT_1 * 5) -+/* Do not bother checking VDO pool is less than 50% full. */ -+#define CHECK_MINIMUM (DM_PERCENT_1 * 50) -+ -+#define MAX_FAILS (256) /* ~42 mins between cmd call retry with 10s delay */ -+ -+#define VDO_DEBUG 0 -+ -+struct dso_state { -+ struct dm_pool *mem; -+ int percent_check; -+ int percent; -+ uint64_t known_data_size; -+ unsigned fails; -+ unsigned max_fails; -+ int restore_sigset; -+ sigset_t old_sigset; -+ pid_t pid; -+ char *argv[3]; -+ const char *cmd_str; -+ const char *name; -+}; -+ -+DM_EVENT_LOG_FN("vdo") -+ -+static int _run_command(struct dso_state *state) -+{ -+ char val[16]; -+ int i; -+ -+ /* Mark for possible lvm2 command we are running from dmeventd -+ * lvm2 will not try to talk back to dmeventd while processing it */ -+ (void) setenv("LVM_RUN_BY_DMEVENTD", "1", 1); -+ -+ if (state->percent) { -+ /* Prepare some known data to env vars for easy use */ -+ if (dm_snprintf(val, sizeof(val), "%d", -+ state->percent / DM_PERCENT_1) != -1) -+ (void) setenv("DMEVENTD_VDO_POOL", val, 1); -+ } else { -+ /* For an error event it's for a user to check status and decide */ -+ log_debug("Error event processing."); -+ } -+ -+ log_verbose("Executing command: %s", state->cmd_str); -+ -+ /* TODO: -+ * Support parallel run of 'task' and it's waitpid maintainence -+ * ATM we can't handle signaling of SIGALRM -+ * as signalling is not allowed while 'process_event()' is running -+ */ -+ if (!(state->pid = fork())) { -+ /* child */ -+ (void) close(0); -+ for (i = 3; i < 255; ++i) (void) close(i); -+ execvp(state->argv[0], state->argv); -+ _exit(errno); -+ } else if (state->pid == -1) { -+ log_error("Can't fork command %s.", state->cmd_str); -+ state->fails = 1; -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static int _use_policy(struct dm_task *dmt, struct dso_state *state) -+{ -+#if VDO_DEBUG -+ log_debug("dmeventd executes: %s.", state->cmd_str); -+#endif -+ if (state->argv[0]) -+ return _run_command(state); -+ -+ if (!dmeventd_lvm2_run_with_lock(state->cmd_str)) { -+ log_error("Failed command for %s.", dm_task_get_name(dmt)); -+ state->fails = 1; -+ return 0; -+ } -+ -+ state->fails = 0; -+ -+ return 1; -+} -+ -+/* Check if executed command has finished -+ * Only 1 command may run */ -+static int _wait_for_pid(struct dso_state *state) -+{ -+ int status = 0; -+ -+ if (state->pid == -1) -+ return 1; -+ -+ if (!waitpid(state->pid, &status, WNOHANG)) -+ return 0; -+ -+ /* Wait for finish */ -+ if (WIFEXITED(status)) { -+ log_verbose("Child %d exited with status %d.", -+ state->pid, WEXITSTATUS(status)); -+ state->fails = WEXITSTATUS(status) ? 1 : 0; -+ } else { -+ if (WIFSIGNALED(status)) -+ log_verbose("Child %d was terminated with status %d.", -+ state->pid, WTERMSIG(status)); -+ state->fails = 1; -+ } -+ -+ state->pid = -1; -+ -+ return 1; -+} -+ -+void process_event(struct dm_task *dmt, -+ enum dm_event_mask event __attribute__((unused)), -+ void **user) -+{ -+ const char *device = dm_task_get_name(dmt); -+ struct dso_state *state = *user; -+ void *next = NULL; -+ uint64_t start, length; -+ char *target_type = NULL; -+ char *params; -+ int needs_policy = 0; -+ struct dm_task *new_dmt = NULL; -+ struct dm_vdo_status_parse_result vdop = { .status = NULL }; -+ -+#if VDO_DEBUG -+ log_debug("Watch for VDO %s:%.2f%%.", state->name, -+ dm_percent_to_round_float(state->percent_check, 2)); -+#endif -+ if (!_wait_for_pid(state)) { -+ log_warn("WARNING: Skipping event, child %d is still running (%s).", -+ state->pid, state->cmd_str); -+ return; -+ } -+ -+ if (event & DM_EVENT_DEVICE_ERROR) { -+#if VDO_DEBUG -+ log_debug("VDO event error."); -+#endif -+ /* Error -> no need to check and do instant resize */ -+ state->percent = 0; -+ if (_use_policy(dmt, state)) -+ goto out; -+ -+ stack; -+ -+ if (!(new_dmt = dm_task_create(DM_DEVICE_STATUS))) -+ goto_out; -+ -+ if (!dm_task_set_uuid(new_dmt, dm_task_get_uuid(dmt))) -+ goto_out; -+ -+ /* Non-blocking status read */ -+ if (!dm_task_no_flush(new_dmt)) -+ log_warn("WARNING: Can't set no_flush for dm status."); -+ -+ if (!dm_task_run(new_dmt)) -+ goto_out; -+ -+ dmt = new_dmt; -+ } -+ -+ dm_get_next_target(dmt, next, &start, &length, &target_type, ¶ms); -+ -+ if (!target_type || (strcmp(target_type, "vdo") != 0)) { -+ log_error("Invalid target type."); -+ goto out; -+ } -+ -+ if (!dm_vdo_status_parse(state->mem, params, &vdop)) { -+ log_error("Failed to parse status."); -+ goto out; -+ } -+ -+ state->percent = dm_make_percent(vdop.status->used_blocks, -+ vdop.status->total_blocks); -+ -+#if VDO_DEBUG -+ log_debug("VDO %s status %.2f%% " FMTu64 "/" FMTu64 ".", -+ state->name, dm_percent_to_round_float(state->percent, 2), -+ vdop.status->used_blocks, vdop.status->total_blocks); -+#endif -+ -+ /* VDO pool size had changed. Clear the threshold. */ -+ if (state->known_data_size != vdop.status->total_blocks) { -+ state->percent_check = CHECK_MINIMUM; -+ state->known_data_size = vdop.status->total_blocks; -+ state->fails = 0; -+ } -+ -+ /* -+ * Trigger action when threshold boundary is exceeded. -+ * Report 80% threshold warning when it's used above 80%. -+ * Only 100% is exception as it cannot be surpased so policy -+ * action is called for: >50%, >55% ... >95%, 100% -+ */ -+ if ((state->percent > WARNING_THRESH) && -+ (state->percent > state->percent_check)) -+ log_warn("WARNING: VDO %s %s is now %.2f%% full.", -+ state->name, device, -+ dm_percent_to_round_float(state->percent, 2)); -+ if (state->percent > CHECK_MINIMUM) { -+ /* Run action when usage raised more than CHECK_STEP since the last time */ -+ if (state->percent > state->percent_check) -+ needs_policy = 1; -+ state->percent_check = (state->percent / CHECK_STEP + 1) * CHECK_STEP; -+ if (state->percent_check == DM_PERCENT_100) -+ state->percent_check--; /* Can't get bigger then 100% */ -+ } else -+ state->percent_check = CHECK_MINIMUM; -+ -+ /* Reduce number of _use_policy() calls by power-of-2 factor till frequency of MAX_FAILS is reached. -+ * Avoids too high number of error retries, yet shows some status messages in log regularly. -+ * i.e. PV could have been pvmoved and VG/LV was locked for a while... -+ */ -+ if (state->fails) { -+ if (state->fails++ <= state->max_fails) { -+ log_debug("Postponing frequently failing policy (%u <= %u).", -+ state->fails - 1, state->max_fails); -+ return; -+ } -+ if (state->max_fails < MAX_FAILS) -+ state->max_fails <<= 1; -+ state->fails = needs_policy = 1; /* Retry failing command */ -+ } else -+ state->max_fails = 1; /* Reset on success */ -+ -+ /* FIXME: ATM nothing can be done, drop 0, once it becomes useful */ -+ if (0 && needs_policy) -+ _use_policy(dmt, state); -+out: -+ if (vdop.status) -+ dm_pool_free(state->mem, vdop.status); -+ -+ if (new_dmt) -+ dm_task_destroy(new_dmt); -+} -+ -+/* Handle SIGCHLD for a thread */ -+static void _sig_child(int signum __attribute__((unused))) -+{ -+ /* empty SIG_IGN */; -+} -+ -+/* Setup handler for SIGCHLD when executing external command -+ * to get quick 'waitpid()' reaction -+ * It will interrupt syscall just like SIGALRM and -+ * invoke process_event(). -+ */ -+static void _init_thread_signals(struct dso_state *state) -+{ -+ struct sigaction act = { .sa_handler = _sig_child }; -+ sigset_t my_sigset; -+ -+ sigemptyset(&my_sigset); -+ -+ if (sigaction(SIGCHLD, &act, NULL)) -+ log_warn("WARNING: Failed to set SIGCHLD action."); -+ else if (sigaddset(&my_sigset, SIGCHLD)) -+ log_warn("WARNING: Failed to add SIGCHLD to set."); -+ else if (pthread_sigmask(SIG_UNBLOCK, &my_sigset, &state->old_sigset)) -+ log_warn("WARNING: Failed to unblock SIGCHLD."); -+ else -+ state->restore_sigset = 1; -+} -+ -+static void _restore_thread_signals(struct dso_state *state) -+{ -+ if (state->restore_sigset && -+ pthread_sigmask(SIG_SETMASK, &state->old_sigset, NULL)) -+ log_warn("WARNING: Failed to block SIGCHLD."); -+} -+ -+int register_device(const char *device, -+ const char *uuid, -+ int major __attribute__((unused)), -+ int minor __attribute__((unused)), -+ void **user) -+{ -+ struct dso_state *state; -+ const char *cmd; -+ char *str; -+ char cmd_str[PATH_MAX + 128 + 2]; /* cmd ' ' vg/lv \0 */ -+ const char *name = "pool"; -+ -+ if (!dmeventd_lvm2_init_with_pool("vdo_pool_state", state)) -+ goto_bad; -+ -+ state->cmd_str = ""; -+ -+ /* Search for command for LVM- prefixed devices only */ -+ cmd = (strncmp(uuid, "LVM-", 4) == 0) ? "_dmeventd_vdo_command" : ""; -+ -+ if (!dmeventd_lvm2_command(state->mem, cmd_str, sizeof(cmd_str), cmd, device)) -+ goto_bad; -+ -+ if (strncmp(cmd_str, "lvm ", 4) == 0) { -+ if (!(state->cmd_str = dm_pool_strdup(state->mem, cmd_str + 4))) { -+ log_error("Failed to copy lvm VDO command."); -+ goto bad; -+ } -+ } else if (cmd_str[0] == '/') { -+ if (!(state->cmd_str = dm_pool_strdup(state->mem, cmd_str))) { -+ log_error("Failed to copy VDO command."); -+ goto bad; -+ } -+ -+ /* Find last space before 'vg/lv' */ -+ if (!(str = strrchr(state->cmd_str, ' '))) -+ goto inval; -+ -+ if (!(state->argv[0] = dm_pool_strndup(state->mem, state->cmd_str, -+ str - state->cmd_str))) { -+ log_error("Failed to copy command."); -+ goto bad; -+ } -+ -+ state->argv[1] = str + 1; /* 1 argument - vg/lv */ -+ _init_thread_signals(state); -+ } else if (cmd[0] == 0) { -+ state->name = "volume"; /* What to use with 'others?' */ -+ } else/* Unuspported command format */ -+ goto inval; -+ -+ state->pid = -1; -+ state->name = name; -+ *user = state; -+ -+ log_info("Monitoring VDO %s %s.", name, device); -+ -+ return 1; -+inval: -+ log_error("Invalid command for monitoring: %s.", cmd_str); -+bad: -+ log_error("Failed to monitor VDO %s %s.", name, device); -+ -+ if (state) -+ dmeventd_lvm2_exit_with_pool(state); -+ -+ return 0; -+} -+ -+int unregister_device(const char *device, -+ const char *uuid __attribute__((unused)), -+ int major __attribute__((unused)), -+ int minor __attribute__((unused)), -+ void **user) -+{ -+ struct dso_state *state = *user; -+ const char *name = state->name; -+ int i; -+ -+ for (i = 0; !_wait_for_pid(state) && (i < 6); ++i) { -+ if (i == 0) -+ /* Give it 2 seconds, then try to terminate & kill it */ -+ log_verbose("Child %d still not finished (%s) waiting.", -+ state->pid, state->cmd_str); -+ else if (i == 3) { -+ log_warn("WARNING: Terminating child %d.", state->pid); -+ kill(state->pid, SIGINT); -+ kill(state->pid, SIGTERM); -+ } else if (i == 5) { -+ log_warn("WARNING: Killing child %d.", state->pid); -+ kill(state->pid, SIGKILL); -+ } -+ sleep(1); -+ } -+ -+ if (state->pid != -1) -+ log_warn("WARNING: Cannot kill child %d!", state->pid); -+ -+ _restore_thread_signals(state); -+ -+ dmeventd_lvm2_exit_with_pool(state); -+ log_info("No longer monitoring VDO %s %s.", name, device); -+ -+ return 1; -+} diff --git a/SOURCES/lvm2-2_02_181-dmeventd-rebase-to-stable-branch.patch b/SOURCES/lvm2-2_02_181-dmeventd-rebase-to-stable-branch.patch deleted file mode 100644 index 05cdc33..0000000 --- a/SOURCES/lvm2-2_02_181-dmeventd-rebase-to-stable-branch.patch +++ /dev/null @@ -1,94 +0,0 @@ - daemons/dmeventd/plugins/vdo/dmeventd_vdo.c | 39 +++++++++++++++++++---------- - 1 file changed, 26 insertions(+), 13 deletions(-) - -diff --git a/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c -index d77ca79..389632c 100644 ---- a/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c -+++ b/daemons/dmeventd/plugins/vdo/dmeventd_vdo.c -@@ -12,10 +12,9 @@ - * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - */ - --#include "lib/misc/lib.h" -+#include "lib.h" - #include "dmeventd_lvm.h" --#include "daemons/dmeventd/libdevmapper-event.h" --#include "device_mapper/vdo/target.h" -+#include "libdevmapper-event.h" - - #include - #include -@@ -46,6 +45,23 @@ struct dso_state { - const char *name; - }; - -+struct vdo_status { -+ uint64_t used_blocks; -+ uint64_t total_blocks; -+}; -+ -+static int _vdo_status_parse(const char *params, struct vdo_status *status) -+{ -+ if (sscanf(params, "%*s %*s %*s %*s %*s %" PRIu64 " %" PRIu64, -+ &status->used_blocks, -+ &status->total_blocks) < 2) { -+ log_error("Failed to parse vdo params: %s.", params); -+ return 0; -+ } -+ -+ return 1; -+} -+ - DM_EVENT_LOG_FN("vdo") - - static int _run_command(struct dso_state *state) -@@ -149,7 +165,7 @@ void process_event(struct dm_task *dmt, - char *params; - int needs_policy = 0; - struct dm_task *new_dmt = NULL; -- struct dm_vdo_status_parse_result vdop = { .status = NULL }; -+ struct vdo_status status; - - #if VDO_DEBUG - log_debug("Watch for VDO %s:%.2f%%.", state->name, -@@ -195,24 +211,24 @@ void process_event(struct dm_task *dmt, - goto out; - } - -- if (!dm_vdo_status_parse(state->mem, params, &vdop)) { -+ if (!_vdo_status_parse(params, &status)) { - log_error("Failed to parse status."); - goto out; - } - -- state->percent = dm_make_percent(vdop.status->used_blocks, -- vdop.status->total_blocks); -+ state->percent = dm_make_percent(status.used_blocks, -+ status.total_blocks); - - #if VDO_DEBUG - log_debug("VDO %s status %.2f%% " FMTu64 "/" FMTu64 ".", - state->name, dm_percent_to_round_float(state->percent, 2), -- vdop.status->used_blocks, vdop.status->total_blocks); -+ status.used_blocks, status.total_blocks); - #endif - - /* VDO pool size had changed. Clear the threshold. */ -- if (state->known_data_size != vdop.status->total_blocks) { -+ if (state->known_data_size != status.total_blocks) { - state->percent_check = CHECK_MINIMUM; -- state->known_data_size = vdop.status->total_blocks; -+ state->known_data_size = status.total_blocks; - state->fails = 0; - } - -@@ -257,9 +273,6 @@ void process_event(struct dm_task *dmt, - if (0 && needs_policy) - _use_policy(dmt, state); - out: -- if (vdop.status) -- dm_pool_free(state->mem, vdop.status); -- - if (new_dmt) - dm_task_destroy(new_dmt); - } diff --git a/SOURCES/lvm2-2_02_181-dmsetup-fix-error-propagation-in-_display_info_cols.patch b/SOURCES/lvm2-2_02_181-dmsetup-fix-error-propagation-in-_display_info_cols.patch deleted file mode 100644 index 8a1a079..0000000 --- a/SOURCES/lvm2-2_02_181-dmsetup-fix-error-propagation-in-_display_info_cols.patch +++ /dev/null @@ -1,19 +0,0 @@ - tools/dmsetup.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/tools/dmsetup.c b/tools/dmsetup.c -index 95a15dd..3cdf862 100644 ---- a/tools/dmsetup.c -+++ b/tools/dmsetup.c -@@ -939,8 +939,10 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info) - goto_out; - - /* No regions to report is not an error */ -- if (!dm_stats_get_nr_regions(obj.stats)) -+ if (!dm_stats_get_nr_regions(obj.stats)) { -+ r = 1; - goto out; -+ } - } - - /* group report with no groups? */ diff --git a/SOURCES/lvm2-2_02_181-lvconvert-improve-text-about-splitmirrors.patch b/SOURCES/lvm2-2_02_181-lvconvert-improve-text-about-splitmirrors.patch deleted file mode 100644 index 32fd96d..0000000 --- a/SOURCES/lvm2-2_02_181-lvconvert-improve-text-about-splitmirrors.patch +++ /dev/null @@ -1,72 +0,0 @@ - lib/metadata/raid_manip.c | 4 ++-- - tools/args.h | 14 +++++++++----- - tools/command-lines.in | 2 +- - 3 files changed, 12 insertions(+), 8 deletions(-) - -diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c -index 8f78e1a..705a7f9 100644 ---- a/lib/metadata/raid_manip.c -+++ b/lib/metadata/raid_manip.c -@@ -3563,7 +3563,7 @@ int lv_raid_merge(struct logical_volume *image_lv) - struct volume_group *vg = image_lv->vg; - - if (image_lv->status & LVM_WRITE) { -- log_error("%s is not read-only - refusing to merge.", -+ log_error("%s cannot be merged because --trackchanges was not used.", - display_lvname(image_lv)); - return 0; - } -@@ -3572,7 +3572,7 @@ int lv_raid_merge(struct logical_volume *image_lv) - return_0; - - if (!(p = strstr(lv_name, "_rimage_"))) { -- log_error("Unable to merge non-mirror image %s.", -+ log_error("Unable to merge non-raid image %s.", - display_lvname(image_lv)); - return 0; - } -diff --git a/tools/args.h b/tools/args.h -index b80b8da..abe193c 100644 ---- a/tools/args.h -+++ b/tools/args.h -@@ -611,7 +611,9 @@ arg(splitcache_ARG, '\0', "splitcache", 0, 0, 0, - arg(splitmirrors_ARG, '\0', "splitmirrors", number_VAL, 0, 0, - "Splits the specified number of images from a raid1 or mirror LV\n" - "and uses them to create a new LV. If --trackchanges is also specified,\n" -- "changes to the raid1 LV are tracked while the split LV remains detached.\n") -+ "changes to the raid1 LV are tracked while the split LV remains detached.\n" -+ "If --name is specified, then the images are permanently split from the\n" -+ "original LV and changes are not tracked.\n") - - arg(splitsnapshot_ARG, '\0', "splitsnapshot", 0, 0, 0, - "Separates a COW snapshot from its origin LV. The LV that is split off\n" -@@ -691,10 +693,12 @@ arg(thinpool_ARG, '\0', "thinpool", lv_VAL, 0, 0, - arg(trackchanges_ARG, '\0', "trackchanges", 0, 0, 0, - "Can be used with --splitmirrors on a raid1 LV. This causes\n" - "changes to the original raid1 LV to be tracked while the split images\n" -- "remain detached. This allows the read-only detached image(s) to be\n" -- "merged efficiently back into the raid1 LV later. Only the regions with\n" -- "changed data are resynchronized during merge. (This option only applies\n" -- "when using the raid1 LV type.)\n") -+ "remain detached. This is a temporary state that allows the read-only\n" -+ "detached image to be merged efficiently back into the raid1 LV later.\n" -+ "Only the regions with changed data are resynchronized during merge.\n" -+ "While a raid1 LV is tracking changes, operations on it are limited to\n" -+ "merging the split image (see --mergemirrors) or permanently splitting\n" -+ "the image (see --splitmirrors with --name.\n") - - /* TODO: hide this? */ - arg(trustcache_ARG, '\0', "trustcache", 0, 0, 0, -diff --git a/tools/command-lines.in b/tools/command-lines.in -index b7aefa3..a8c06ba 100644 ---- a/tools/command-lines.in -+++ b/tools/command-lines.in -@@ -399,7 +399,7 @@ lvconvert --splitmirrors Number --trackchanges LV_raid1_cache - OO: OO_LVCONVERT - OP: PV ... - ID: lvconvert_split_mirror_images --DESC: Split images from a raid1 LV and track changes to origin. -+DESC: Split images from a raid1 LV and track changes to origin for later merge. - RULE: all not lv_is_locked lv_is_pvmove - - lvconvert --mergemirrors LV_linear_raid|VG|Tag ... diff --git a/SOURCES/lvm2-2_02_181-lvconvert-reject-conversions-of-LVs-under-snapshot.patch b/SOURCES/lvm2-2_02_181-lvconvert-reject-conversions-of-LVs-under-snapshot.patch deleted file mode 100644 index 78dfd4e..0000000 --- a/SOURCES/lvm2-2_02_181-lvconvert-reject-conversions-of-LVs-under-snapshot.patch +++ /dev/null @@ -1,20 +0,0 @@ - tools/lvconvert.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index 3ce228f..3fad02c 100644 ---- a/tools/lvconvert.c -+++ b/tools/lvconvert.c -@@ -4256,6 +4256,12 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd, - return 0; - }; - -+ if (lv_is_origin(lv)) { -+ log_error("Cannot convert logical volume %s under snapshot.", -+ display_lvname(lv)); -+ return 0; -+ }; -+ - if (cmd->position_argc > 1) { - /* First pos arg is required LV, remaining are optional PVs. */ - if (!(use_pvh = create_pv_list(cmd->mem, lv->vg, cmd->position_argc - 1, cmd->position_argv + 1, 0))) diff --git a/SOURCES/lvm2-2_02_181-lvconvert-restrict-command-matching-for-no-option-va.patch b/SOURCES/lvm2-2_02_181-lvconvert-restrict-command-matching-for-no-option-va.patch deleted file mode 100644 index 61608ed..0000000 --- a/SOURCES/lvm2-2_02_181-lvconvert-restrict-command-matching-for-no-option-va.patch +++ /dev/null @@ -1,69 +0,0 @@ - lib/commands/toolcontext.h | 1 + - tools/command-lines.in | 2 +- - tools/lvmcmdline.c | 14 ++++++++++++++ - 3 files changed, 16 insertions(+), 1 deletion(-) - -diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h -index bc05736..da5d582 100644 ---- a/lib/commands/toolcontext.h -+++ b/lib/commands/toolcontext.h -@@ -95,6 +95,7 @@ struct cmd_context { - char **argv; - struct arg_values *opt_arg_values; - struct dm_list arg_value_groups; -+ int opt_count; /* total number of options (beginning with - or --) */ - - /* - * Position args remaining after command name -diff --git a/tools/command-lines.in b/tools/command-lines.in -index 9d407d0..b7aefa3 100644 ---- a/tools/command-lines.in -+++ b/tools/command-lines.in -@@ -700,7 +700,7 @@ RULE: all and lv_is_converting - # for compat since this was how it used to be done. - lvconvert LV_mirror_raid - OO: OO_LVCONVERT --ID: lvconvert_start_poll -+ID: lvconvert_plain - DESC: Poll LV to continue conversion (also see --startpoll) - DESC: or waits till conversion/mirror syncing is finished - FLAGS: SECONDARY_SYNTAX -diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c -index 0600b1c..c62a66e 100644 ---- a/tools/lvmcmdline.c -+++ b/tools/lvmcmdline.c -@@ -119,6 +119,7 @@ static const struct command_function _command_functions[CMD_COUNT] = { - - /* lvconvert utility to trigger polling on an LV. */ - { lvconvert_start_poll_CMD, lvconvert_start_poll_cmd }, -+ { lvconvert_plain_CMD, lvconvert_start_poll_cmd }, - - /* lvconvert utilities for creating/maintaining thin and cache objects. */ - { lvconvert_to_thinpool_CMD, lvconvert_to_pool_cmd }, -@@ -1579,6 +1580,17 @@ static struct command *_find_command(struct cmd_context *cmd, const char *path, - if (arg_is_set(cmd, help_ARG) || arg_is_set(cmd, help2_ARG) || arg_is_set(cmd, longhelp_ARG) || arg_is_set(cmd, version_ARG)) - return &commands[i]; - -+ /* -+ * The 'lvconvert LV' cmd def matches any lvconvert cmd which throws off -+ * nearest-command partial-match suggestions. Make it a special case so -+ * that it won't be used as a close match. If the command has any option -+ * set (other than -v), don't attempt to match it to 'lvconvert LV'. -+ */ -+ if (commands[i].command_enum == lvconvert_plain_CMD) { -+ if (cmd->opt_count - cmd->opt_arg_values[verbose_ARG].count) -+ continue; -+ } -+ - match_required = 0; /* required parameters that match */ - match_ro = 0; /* required opt_args that match */ - match_rp = 0; /* required pos_args that match */ -@@ -2097,6 +2109,8 @@ static int _process_command_line(struct cmd_context *cmd, int *argc, char ***arg - if (goval == '?') - return 0; - -+ cmd->opt_count++; -+ - /* - * translate the option value used by getopt into the enum - * value (e.g. foo_ARG) from the args array. diff --git a/SOURCES/lvm2-2_02_181-post-release.patch b/SOURCES/lvm2-2_02_181-post-release.patch deleted file mode 100644 index 126d1bd..0000000 --- a/SOURCES/lvm2-2_02_181-post-release.patch +++ /dev/null @@ -1,26 +0,0 @@ - WHATS_NEW | 3 +++ - WHATS_NEW_DM | 3 +++ - 2 files changed, 6 insertions(+) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 62a5045..bdd2fa6 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,3 +1,6 @@ -+Version 2.02.181 - -+================================= -+ - Version 2.02.180 - 19th July 2018 - ================================= - Never send any discard ioctl with test mode. -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index 93e4b14..e77352a 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,3 +1,6 @@ -+Version 1.02.150 - -+================================= -+ - Version 1.02.149 - 19th July 2018 - ================================= - diff --git a/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-LVs.patch b/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-LVs.patch deleted file mode 100644 index 68c7b5d..0000000 --- a/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-LVs.patch +++ /dev/null @@ -1,51 +0,0 @@ - WHATS_NEW | 1 + - test/shell/lvconvert-raid1-split-trackchanges.sh | 7 +++++++ - tools/lvconvert.c | 6 ++++++ - 3 files changed, 14 insertions(+) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 7c74c50..3b15325 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.181 - - ================================= -+ lvconvert: reject conversions on raid1 LVs with split tracked SubLVs - lvconvert: reject conversions on raid1 split tracked SubLVs - - Version 2.02.180 - 19th July 2018 -diff --git a/test/shell/lvconvert-raid1-split-trackchanges.sh b/test/shell/lvconvert-raid1-split-trackchanges.sh -index e25a632..718c254 100644 ---- a/test/shell/lvconvert-raid1-split-trackchanges.sh -+++ b/test/shell/lvconvert-raid1-split-trackchanges.sh -@@ -27,6 +27,13 @@ vgcreate $SHARED -s 512k "$vg" "${DEVICES[@]}" - lvcreate -y --ty raid1 -m 2 -n $lv1 -l 1 $vg - lvconvert -y --splitmirrors 1 --trackchanges $vg/$lv1 - -+not lvconvert -y --ty linear $vg/$lv1 -+not lvconvert -y --ty striped -i 3 $vg/$lv1 -+not lvconvert -y --ty mirror $vg/$lv1 -+not lvconvert -y --ty raid4 $vg/$lv1 -+not lvconvert -y --ty raid5 $vg/$lv1 -+not lvconvert -y --ty raid6 $vg/$lv1 -+not lvconvert -y --ty raid10 $vg/$lv1 - not lvconvert -y --ty striped -m 1 $vg/${lv1}_rimage_2 - not lvconvert -y --ty raid1 -m 1 $vg/${lv1}_rimage_2 - not lvconvert -y --ty mirror -m 1 $vg/${lv1}_rimage_2 -diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index 079c3cd..731a210 100644 ---- a/tools/lvconvert.c -+++ b/tools/lvconvert.c -@@ -1170,6 +1170,12 @@ static int _raid_split_image_conversion(struct logical_volume *lv) - { - const char *s; - -+ if (lv_is_raid_with_tracking(lv)) { -+ log_error("Conversion of tracking raid1 LV %s is not supported.", -+ display_lvname(lv)); -+ return 1; -+ } -+ - if (lv_is_raid_image(lv) && - (s = strstr(lv->name, "_rimage_"))) { - size_t len = s - lv->name; diff --git a/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-SubLVs.patch b/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-SubLVs.patch deleted file mode 100644 index f822a79..0000000 --- a/SOURCES/lvm2-2_02_181-reject-conversions-trackchanges-SubLVs.patch +++ /dev/null @@ -1,150 +0,0 @@ - WHATS_NEW | 1 + - test/shell/lvconvert-raid1-split-trackchanges.sh | 36 +++++++++++++++++++ - tools/lvconvert.c | 45 ++++++++++++++++++++++++ - 3 files changed, 82 insertions(+) - create mode 100644 test/shell/lvconvert-raid1-split-trackchanges.sh - -diff --git a/WHATS_NEW b/WHATS_NEW -index bdd2fa6..7c74c50 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.181 - - ================================= -+ lvconvert: reject conversions on raid1 split tracked SubLVs - - Version 2.02.180 - 19th July 2018 - ================================= -diff --git a/test/shell/lvconvert-raid1-split-trackchanges.sh b/test/shell/lvconvert-raid1-split-trackchanges.sh -new file mode 100644 -index 0000000..e25a632 ---- /dev/null -+++ b/test/shell/lvconvert-raid1-split-trackchanges.sh -@@ -0,0 +1,36 @@ -+#!/usr/bin/env bash -+ -+# Copyright (C) 2018 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 -+ -+ -+SKIP_WITH_LVMPOLLD=1 -+ -+. lib/inittest -+ -+# rhbz1579072/rhbz1579438 -+ -+aux have_raid 1 3 0 || skip -+ -+# 8 PVs needed for RAID10 testing (4-stripes/2-mirror) -+aux prepare_pvs 4 2 -+get_devs -+vgcreate $SHARED -s 512k "$vg" "${DEVICES[@]}" -+ -+lvcreate -y --ty raid1 -m 2 -n $lv1 -l 1 $vg -+lvconvert -y --splitmirrors 1 --trackchanges $vg/$lv1 -+ -+not lvconvert -y --ty striped -m 1 $vg/${lv1}_rimage_2 -+not lvconvert -y --ty raid1 -m 1 $vg/${lv1}_rimage_2 -+not lvconvert -y --ty mirror -m 1 $vg/${lv1}_rimage_2 -+not lvconvert -y --ty cache-pool $vg/${lv1}_rimage_2 -+not lvconvert -y --ty thin-pool $vg/${lv1}_rimage_2 -+ -+vgremove -ff $vg -diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index 3fad02c..079c3cd 100644 ---- a/tools/lvconvert.c -+++ b/tools/lvconvert.c -@@ -1165,6 +1165,36 @@ static int _lvconvert_validate_thin(struct logical_volume *lv, - return 0; - } - -+/* Check for raid1 split trackchanges image to reject conversions on it. */ -+static int _raid_split_image_conversion(struct logical_volume *lv) -+{ -+ const char *s; -+ -+ if (lv_is_raid_image(lv) && -+ (s = strstr(lv->name, "_rimage_"))) { -+ size_t len = s - lv->name; -+ char raidlv_name[len + 1]; -+ const struct logical_volume *tmp_lv; -+ -+ strncpy(raidlv_name, lv->name, len); -+ raidlv_name[len] = '\0'; -+ -+ if (!(tmp_lv = find_lv(lv->vg, raidlv_name))) { -+ log_error(INTERNAL_ERROR "Failed to find RaidLV of RAID subvolume %s.", -+ display_lvname(lv)); -+ return 1; -+ } -+ -+ if (lv_is_raid_with_tracking(tmp_lv)) { -+ log_error("Conversion of tracked raid1 subvolume %s is not supported.", -+ display_lvname(lv)); -+ return 1; -+ } -+ } -+ -+ return 0; -+} -+ - /* - * _lvconvert_mirrors - * -@@ -1180,6 +1210,9 @@ static int _lvconvert_mirrors(struct cmd_context *cmd, - uint32_t new_mimage_count = 0; - uint32_t new_log_count = 0; - -+ if (_raid_split_image_conversion(lv)) -+ return 0; -+ - if ((lp->corelog || lp->mirrorlog) && *lp->type_str && strcmp(lp->type_str, SEG_TYPE_NAME_MIRROR)) { - log_error("--corelog and --mirrorlog are only compatible with mirror devices."); - return 0; -@@ -1296,6 +1329,9 @@ static int _lvconvert_raid(struct logical_volume *lv, struct lvconvert_params *l - struct cmd_context *cmd = lv->vg->cmd; - struct lv_segment *seg = first_seg(lv); - -+ if (_raid_split_image_conversion(lv)) -+ return 0; -+ - if (_linear_type_requested(lp->type_str)) { - if (arg_is_set(cmd, mirrors_ARG) && (arg_uint_value(cmd, mirrors_ARG, 0) != 0)) { - log_error("Cannot specify mirrors with linear type."); -@@ -2579,6 +2615,9 @@ static int _lvconvert_to_thin_with_external(struct cmd_context *cmd, - .virtual_extents = lv->le_count, - }; - -+ if (_raid_split_image_conversion(lv)) -+ return 0; -+ - if (lv == thinpool_lv) { - log_error("Can't use same LV %s for thin pool and thin volume.", - display_lvname(thinpool_lv)); -@@ -2888,6 +2927,9 @@ static int _lvconvert_to_pool(struct cmd_context *cmd, - struct id lockd_meta_id; - const char *str_seg_type = to_cachepool ? SEG_TYPE_NAME_CACHE_POOL : SEG_TYPE_NAME_THIN_POOL; - -+ if (_raid_split_image_conversion(lv)) -+ return 0; -+ - if (lv_is_thin_pool(lv) || lv_is_cache_pool(lv)) { - log_error(INTERNAL_ERROR "LV %s is already a pool.", display_lvname(lv)); - return 0; -@@ -3339,6 +3381,9 @@ static int _lvconvert_to_cache_vol(struct cmd_context *cmd, - struct dm_config_tree *policy_settings = NULL; - int r = 0; - -+ if (_raid_split_image_conversion(lv)) -+ return 0; -+ - /* If LV is inactive here, ensure it's not active elsewhere. */ - if (!lockd_lv(cmd, lv, "ex", 0)) - return_0; diff --git a/SOURCES/lvm2-2_02_182-bcache-reduce-MAX_IO-to-256.patch b/SOURCES/lvm2-2_02_182-bcache-reduce-MAX_IO-to-256.patch deleted file mode 100644 index 3577f9f..0000000 --- a/SOURCES/lvm2-2_02_182-bcache-reduce-MAX_IO-to-256.patch +++ /dev/null @@ -1,37 +0,0 @@ - WHATS_NEW | 1 + - lib/device/bcache.c | 10 +++++++++- - 2 files changed, 10 insertions(+), 1 deletion(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 47db4a3..8063364 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -10,6 +10,7 @@ Version 2.02.182 - - Fix change of monitoring in clustered volumes. - Fix lvconvert striped/raid0/raid0_meta -> raid6 regression. - Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. -+ Reduce max concurrent aios to avoid EMFILE with many devices. - Fix lvconvert conversion attempts to linear. - Fix lvconvert raid0/raid0_meta -> striped regression. - Fix lvconvert --splitmirror for mirror type (2.02.178). -diff --git a/lib/device/bcache.c b/lib/device/bcache.c -index 6886b74..7384a32 100644 ---- a/lib/device/bcache.c -+++ b/lib/device/bcache.c -@@ -253,7 +253,15 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd, - return true; - } - --#define MAX_IO 1024 -+/* -+ * MAX_IO is returned to the layer above via bcache_max_prefetches() which -+ * tells the caller how many devices to submit io for concurrently. There will -+ * be an open file descriptor for each of these, so keep it low enough to avoid -+ * reaching the default max open file limit (1024) when there are over 1024 -+ * devices being scanned. -+ */ -+ -+#define MAX_IO 256 - #define MAX_EVENT 64 - - static bool _async_wait(struct io_engine *ioe, io_complete_fn fn) diff --git a/SOURCES/lvm2-2_02_182-cache-drop-metadata_format-validation.patch b/SOURCES/lvm2-2_02_182-cache-drop-metadata_format-validation.patch deleted file mode 100644 index 6c92fad..0000000 --- a/SOURCES/lvm2-2_02_182-cache-drop-metadata_format-validation.patch +++ /dev/null @@ -1,36 +0,0 @@ - WHATS_NEW | 4 ++++ - lib/metadata/cache_manip.c | 5 ----- - 2 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 546d3e6..17aff08 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,3 +1,7 @@ -+Version 2.02.182 - -+============================== -+ Do not pair cache policy and cache metadata format. -+ - Version 2.02.181 - - ================================= - Reject conversions on raid1 LVs with split tracked SubLVs. -diff --git a/lib/metadata/cache_manip.c b/lib/metadata/cache_manip.c -index c15f117..8376bfb 100644 ---- a/lib/metadata/cache_manip.c -+++ b/lib/metadata/cache_manip.c -@@ -843,15 +843,10 @@ int cache_set_metadata_format(struct lv_segment *seg, cache_metadata_format_t fo - - /* - * If policy is unselected, but format 2 is selected, policy smq is enforced. -- * ATM no other then smq & cleaner policy is allowed to select format 2. - */ - if (!seg->policy_name) { - if (format == CACHE_METADATA_FORMAT_2) - seg->policy_name = "smq"; -- } else if (strcmp(seg->policy_name, "smq") && -- strcmp(seg->policy_name, "cleaner")) { -- seg->cache_metadata_format = CACHE_METADATA_FORMAT_1; -- return 1; - } - - /* Check if we need to search for configured cache metadata format */ diff --git a/SOURCES/lvm2-2_02_182-dmeventd-lvm2-plugin-uses-envvar-registry.patch b/SOURCES/lvm2-2_02_182-dmeventd-lvm2-plugin-uses-envvar-registry.patch deleted file mode 100644 index 3d79e13..0000000 --- a/SOURCES/lvm2-2_02_182-dmeventd-lvm2-plugin-uses-envvar-registry.patch +++ /dev/null @@ -1,131 +0,0 @@ -From 41d8039e12ebad0727f8c7455ad9392bc61e6414 Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Mon, 27 Aug 2018 10:18:26 +0200 -Subject: [PATCH 1/2] dmeventd: lvm2 plugin uses envvar registry - -Thin plugin started to use configuble setting to allow to configure -usage of external scripts - however to read this value it needed to -execute internal command as dmeventd itself has no access to lvm.conf -and the API for dmeventd plugin has been kept stable. - -The call of command itself was not normally 'a big issue' until users -started to use higher number of monitored LVs and execution of command -got stuck because other monitored resource already started to execute -some other lvm2 command and become blocked waiting on VG lock. - -This scenario revealed necesity to somehow avoid calling lvm2 command -during resource registration - but this requires bigger changes - so -meanwhile this patch tries to minimize the possibility to hit this race -by obtaining any configurable setting just once - such patch is small -and covers majority of problem - yet better solution needs to be -introduced likely with bigger rework of dmeventd. - -TODO: Avoid blocking registration of resource with execution of lvm2 -commands since those can get stuck waiting on mutexes. - -(cherry picked from commit a8d59404f7713ae4f9a3b172dd560ed1364d8bee) - -Conflicts: - WHATS_NEW_DM ---- - WHATS_NEW_DM | 4 +++ - daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c | 49 +++++++++++++++++++++------- - 2 files changed, 42 insertions(+), 11 deletions(-) - -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index c42ee17..42cf2a8 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,3 +1,7 @@ -+Version 1.02.151 - -+============================== -+ Add hot fix to avoiding locking collision when monitoring thin-pools. -+ - Version 1.02.150 - - ================================= - Add vdo plugin for monitoring VDO devices. -diff --git a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c -index 930f9fc..5be11f1 100644 ---- a/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c -+++ b/daemons/dmeventd/plugins/lvm2/dmeventd_lvm.c -@@ -31,6 +31,13 @@ static pthread_mutex_t _register_mutex = PTHREAD_MUTEX_INITIALIZER; - static int _register_count = 0; - static struct dm_pool *_mem_pool = NULL; - static void *_lvm_handle = NULL; -+static DM_LIST_INIT(_env_registry); -+ -+struct env_data { -+ struct dm_list list; -+ const char *cmd; -+ const char *data; -+}; - - DM_EVENT_LOG_FN("#lvm") - -@@ -100,6 +107,7 @@ void dmeventd_lvm2_exit(void) - lvm2_run(_lvm_handle, "_memlock_dec"); - dm_pool_destroy(_mem_pool); - _mem_pool = NULL; -+ dm_list_init(&_env_registry); - lvm2_exit(_lvm_handle); - _lvm_handle = NULL; - log_debug("lvm plugin exited."); -@@ -124,6 +132,8 @@ int dmeventd_lvm2_command(struct dm_pool *mem, char *buffer, size_t size, - static char _internal_prefix[] = "_dmeventd_"; - char *vg = NULL, *lv = NULL, *layer; - int r; -+ struct env_data *env_data; -+ const char *env = NULL; - - if (!dm_split_lvm_name(mem, device, &vg, &lv, &layer)) { - log_error("Unable to determine VG name from %s.", -@@ -137,18 +147,35 @@ int dmeventd_lvm2_command(struct dm_pool *mem, char *buffer, size_t size, - *layer = '\0'; - - if (!strncmp(cmd, _internal_prefix, sizeof(_internal_prefix) - 1)) { -- dmeventd_lvm2_lock(); -- /* output of internal command passed via env var */ -- if (!dmeventd_lvm2_run(cmd)) -- cmd = NULL; -- else if ((cmd = getenv(cmd))) -- cmd = dm_pool_strdup(mem, cmd); /* copy with lock */ -- dmeventd_lvm2_unlock(); -- -- if (!cmd) { -- log_error("Unable to find configured command."); -- return 0; -+ /* check if ENVVAR wasn't already resolved */ -+ dm_list_iterate_items(env_data, &_env_registry) -+ if (!strcmp(cmd, env_data->cmd)) { -+ env = env_data->data; -+ break; -+ } -+ -+ if (!env) { -+ /* run lvm2 command to find out setting value */ -+ dmeventd_lvm2_lock(); -+ if (!dmeventd_lvm2_run(cmd) || -+ !(env = getenv(cmd))) { -+ log_error("Unable to find configured command."); -+ return 0; -+ } -+ /* output of internal command passed via env var */ -+ env = dm_pool_strdup(_mem_pool, env); /* copy with lock */ -+ dmeventd_lvm2_unlock(); -+ if (!env || -+ !(env_data = dm_pool_zalloc(_mem_pool, sizeof(*env_data))) || -+ !(env_data->cmd = dm_pool_strdup(_mem_pool, cmd))) { -+ log_error("Unable to allocate env memory."); -+ return 0; -+ } -+ env_data->data = env; -+ /* add to ENVVAR registry */ -+ dm_list_add(&_env_registry, &env_data->list); - } -+ cmd = env; - } - - r = dm_snprintf(buffer, size, "%s %s/%s", cmd, vg, lv); --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-fix-clustered-mirror-repair.patch b/SOURCES/lvm2-2_02_182-fix-clustered-mirror-repair.patch deleted file mode 100644 index 95be441..0000000 --- a/SOURCES/lvm2-2_02_182-fix-clustered-mirror-repair.patch +++ /dev/null @@ -1,145 +0,0 @@ - WHATS_NEW | 1 + - lib/activate/activate.c | 3 +-- - tools/lvchange.c | 28 +++++++++++++++++++--------- - tools/vgchange.c | 15 +++++++++++++-- - 4 files changed, 34 insertions(+), 13 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index d8a24b0..a1da4b7 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.182 - - ============================== -+ Fix change of monitoring in clustered volumes. - Fix lvconvert striped/raid0/raid0_meta -> raid6 regression. - Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. - Fix lvconvert conversion attempts to linear. -diff --git a/lib/activate/activate.c b/lib/activate/activate.c -index 16704f6..0bc857f 100644 ---- a/lib/activate/activate.c -+++ b/lib/activate/activate.c -@@ -2061,8 +2061,7 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume - } else - continue; - -- if (!vg_write_lock_held() && lv_is_mirror(lv)) { -- mirr_laopts.exclusive = lv_is_active_exclusive_locally(lv) ? 1 : 0; -+ if (!cmd->is_clvmd && !vg_write_lock_held() && lv_is_mirror(lv)) { - /* - * Commands vgchange and lvchange do use read-only lock when changing - * monitoring (--monitor y|n). All other use cases hold 'write-lock' -diff --git a/tools/lvchange.c b/tools/lvchange.c -index 6144852..7e5cb5b 100644 ---- a/tools/lvchange.c -+++ b/tools/lvchange.c -@@ -148,7 +148,8 @@ static int _lvchange_pool_update(struct cmd_context *cmd, - */ - - static int _lvchange_monitoring(struct cmd_context *cmd, -- struct logical_volume *lv) -+ struct logical_volume *lv, -+ int was_refreshed) - { - struct lvinfo info; - -@@ -163,8 +164,15 @@ static int _lvchange_monitoring(struct cmd_context *cmd, - log_verbose("Monitoring LV %s", display_lvname(lv)); - else - log_verbose("Unmonitoring LV %s", display_lvname(lv)); -- if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) -- return_0; -+ -+ if (!was_refreshed) { -+ if (locking_is_clustered()) { -+ /* FIXME: doesn't work when the LV is not lockholder */ -+ if (!lv_refresh(cmd, lv)) -+ return_0; -+ } else if (!monitor_dev_for_events(cmd, lv, 0, dmeventd_monitor_mode())) -+ return_0; -+ } - } - - return 1; -@@ -176,7 +184,8 @@ static int _lvchange_monitoring(struct cmd_context *cmd, - */ - - static int _lvchange_background_polling(struct cmd_context *cmd, -- struct logical_volume *lv) -+ struct logical_volume *lv, -+ int was_refreshed) - { - struct lvinfo info; - -@@ -187,7 +196,8 @@ static int _lvchange_background_polling(struct cmd_context *cmd, - - if (background_polling()) { - log_verbose("Polling LV %s", display_lvname(lv)); -- lv_spawn_background_polling(cmd, lv); -+ if (!was_refreshed) -+ lv_spawn_background_polling(cmd, lv); - } - - return 1; -@@ -1444,11 +1454,11 @@ static int _lvchange_refresh_single(struct cmd_context *cmd, - * checking poll arg. Pull that out of lv_refresh. - */ - if (arg_is_set(cmd, poll_ARG) && -- !_lvchange_background_polling(cmd, lv)) -+ !_lvchange_background_polling(cmd, lv, 1)) - return_ECMD_FAILED; - - if (arg_is_set(cmd, monitor_ARG) && -- !_lvchange_monitoring(cmd, lv)) -+ !_lvchange_monitoring(cmd, lv, 1)) - return_ECMD_FAILED; - - return ECMD_PROCESSED; -@@ -1606,11 +1616,11 @@ static int _lvchange_monitor_poll_single(struct cmd_context *cmd, - struct processing_handle *handle) - { - if (arg_is_set(cmd, monitor_ARG) && -- !_lvchange_monitoring(cmd, lv)) -+ !_lvchange_monitoring(cmd, lv, 0)) - return_ECMD_FAILED; - - if (arg_is_set(cmd, poll_ARG) && -- !_lvchange_background_polling(cmd, lv)) -+ !_lvchange_background_polling(cmd, lv, 0)) - return_ECMD_FAILED; - - return ECMD_PROCESSED; -diff --git a/tools/vgchange.c b/tools/vgchange.c -index 67be3ec..fa2d585 100644 ---- a/tools/vgchange.c -+++ b/tools/vgchange.c -@@ -42,7 +42,16 @@ static int _monitor_lvs_in_vg(struct cmd_context *cmd, - if (lv_is_pvmove(lv)) - continue; - -- if (!monitor_dev_for_events(cmd, lv, 0, reg)) { -+ if (locking_is_clustered()) { -+ if (lv != lv_lock_holder(lv)) -+ continue; -+ if (!lv_refresh(cmd, lv)) { -+ stack; -+ r = 0; -+ continue; -+ } -+ } else if (!monitor_dev_for_events(cmd, lv, 0, reg)) { -+ stack; - r = 0; - continue; - } -@@ -157,8 +166,10 @@ static int _vgchange_monitoring(struct cmd_context *cmd, struct volume_group *vg - - if (lvs_in_vg_activated(vg) && - dmeventd_monitor_mode() != DMEVENTD_MONITOR_IGNORE) { -- if (!_monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode(), &monitored)) -+ if (!_monitor_lvs_in_vg(cmd, vg, dmeventd_monitor_mode(), &monitored)) { -+ stack; - r = 0; -+ } - log_print_unless_silent("%d logical volume(s) in volume group " - "\"%s\" %smonitored", - monitored, vg->name, (dmeventd_monitor_mode()) ? "" : "un"); diff --git a/SOURCES/lvm2-2_02_182-lvconvert-avoid-superfluous-interim-raid-type.patch b/SOURCES/lvm2-2_02_182-lvconvert-avoid-superfluous-interim-raid-type.patch deleted file mode 100644 index 7da9388..0000000 --- a/SOURCES/lvm2-2_02_182-lvconvert-avoid-superfluous-interim-raid-type.patch +++ /dev/null @@ -1,45 +0,0 @@ -From c43515c7ba1d13d54c92d43b76ca0a661c097292 Mon Sep 17 00:00:00 2001 -From: Heinz Mauelshagen -Date: Fri, 31 Aug 2018 19:03:52 +0200 -Subject: [PATCH] lvconvert: avoid superfluous interim raid type - -When converting striped/raid0*/raid6_n_6 <-> raid4, -avoid superfluous interim raid5_n layout. - -Related: rhbz1447809 -(cherry picked from commit 22a13043683a5647e8cc4e3aead911e5269ffd2f) -(cherry picked from commit 0e03c686191b036a7cd6e570888793ddbdd5f958) ---- - lib/metadata/raid_manip.c | 9 ++++----- - 1 file changed, 4 insertions(+), 5 deletions(-) - -diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c -index d3e3a20..3eee77a 100644 ---- a/lib/metadata/raid_manip.c -+++ b/lib/metadata/raid_manip.c -@@ -6140,7 +6140,7 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - seg_flag = SEG_RAID6_N_6; - - if (segtype_is_linear(*segtype) || -- (!segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) -+ (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) - seg_flag = SEG_RAID5_N; - - /* raid1 -> */ -@@ -6209,10 +6209,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count); - } - -- /* raid4 -> !raid4/raid5* */ -- } else if (seg_is_raid4(seg_from) && -- !segtype_is_raid4(*segtype) && !segtype_is_any_raid5(*segtype)) { -- seg_flag = SEG_RAID5_N; -+ /* raid4 -> * */ -+ } else if (seg_is_raid4(seg_from) && !segtype_is_raid4(*segtype) && !segtype_is_striped(*segtype)) { -+ seg_flag = segtype_is_any_raid6(*segtype) ? SEG_RAID6_N_6 : SEG_RAID5_N; - - /* raid6 -> striped/raid0/raid5/raid10 */ - } else if (seg_is_any_raid6(seg_from)) { --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-lvconvert-fix-conversion-attempts-to-linear.patch b/SOURCES/lvm2-2_02_182-lvconvert-fix-conversion-attempts-to-linear.patch deleted file mode 100644 index 9c1b7d1..0000000 --- a/SOURCES/lvm2-2_02_182-lvconvert-fix-conversion-attempts-to-linear.patch +++ /dev/null @@ -1,268 +0,0 @@ -From 83b93f9f5a72ac67f63e6be2c25ce4b3919c4c84 Mon Sep 17 00:00:00 2001 -From: Heinz Mauelshagen -Date: Wed, 22 Aug 2018 16:39:36 +0200 -Subject: [PATCH] lvconvert: fix conversion attempts to linear - -"lvconvert --type linear RaidLV" on striped and raid4/5/6/10 -have to provide the convenient interim layouts. Fix involves -a cleanup to the convenience type function. - -As a result of testing, add missing sync waits to -lvconvert-raid-reshape-linear_to_raid6-single-type.sh. - -Resolves: rhbz1447809 -(cherry picked from commit e83c4f07ca4a84808178d5d22cba655e5e370cd8) - -Conflicts: - WHATS_NEW - -(cherry picked from commit d910f75d89e02e46cd16f9ddbc8e8358c3c2efd3) ---- - WHATS_NEW | 1 + - lib/metadata/raid_manip.c | 145 +++++++++------------ - ...ert-raid-reshape-linear_to_raid6-single-type.sh | 2 + - 3 files changed, 68 insertions(+), 80 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index e3eee56..92e5c04 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.182 - - ============================== -+ Fix lvconvert conversion attempts to linear. - Fix lvconvert raid0/raid0_meta -> striped regression. - Fix lvconvert --splitmirror for mirror type (2.02.178). - Do not pair cache policy and cache metadata format. -diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c -index 804f78b..d3e3a20 100644 ---- a/lib/metadata/raid_manip.c -+++ b/lib/metadata/raid_manip.c -@@ -6120,8 +6120,7 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - const struct segment_type *segtype_sav = *segtype; - - /* Linear -> striped request */ -- if (seg_is_striped(seg_from) && -- seg_from->area_count == 1 && -+ if (seg_is_linear(seg_from) && - segtype_is_striped(*segtype)) - ; - /* Bail out if same RAID level is requested. */ -@@ -6130,24 +6129,20 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - - log_debug("Checking LV %s requested %s segment type for convenience", - display_lvname(seg_from->lv), (*segtype)->name); -- /* striped/raid0 -> raid5/6 */ -- if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) { -- /* linear -> raid*, interim/first conversion is to raid1 */ -- if (seg_from->area_count == 1) -- seg_flag = SEG_RAID1; -- -- else if (seg_is_any_raid0(seg_from) && segtype_is_striped(*segtype)) -- ; -- -- /* If this is any raid5 conversion request -> enforce raid5_n, because we convert from striped */ -- else if (((segtype_is_striped(*segtype) && !segtype_is_any_raid0(*segtype)) || segtype_is_any_raid5(*segtype)) && -- !segtype_is_raid5_n(*segtype)) -- seg_flag = SEG_RAID5_N; - -- /* If this is any raid6 conversion request -> enforce raid6_n_6, because we convert from striped */ -- else if (segtype_is_any_raid6(*segtype) && !segtype_is_raid6_n_6(*segtype)) -+ /* linear -> */ -+ if (seg_is_linear(seg_from)) { -+ seg_flag = SEG_RAID1; -+ -+ /* striped/raid0 -> */ -+ } else if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) { -+ if (segtype_is_any_raid6(*segtype)) - seg_flag = SEG_RAID6_N_6; - -+ if (segtype_is_linear(*segtype) || -+ (!segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) -+ seg_flag = SEG_RAID5_N; -+ - /* raid1 -> */ - } else if (seg_is_raid1(seg_from) && !segtype_is_mirror(*segtype)) { - if (seg_from->area_count != 2) { -@@ -6157,85 +6152,68 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - } - - if (segtype_is_striped(*segtype) || -- segtype_is_any_raid0(*segtype) || -- segtype_is_raid10(*segtype)) -+ segtype_is_any_raid0(*segtype) || -+ segtype_is_raid10(*segtype)) - seg_flag = SEG_RAID5_N; - - else if (!segtype_is_raid4(*segtype) && !segtype_is_any_raid5(*segtype)) - seg_flag = SEG_RAID5_LS; - -- /* raid4/raid5 -> striped/raid0/raid1/raid6/raid10 */ -- } else if (seg_is_raid4(seg_from) || seg_is_any_raid5(seg_from)) { -- if ((segtype_is_raid1(*segtype) || segtype_is_linear(*segtype)) && seg_is_raid5_n(seg_from)) { -+ /* raid5* -> */ -+ } else if (seg_is_any_raid5(seg_from)) { -+ if (segtype_is_raid1(*segtype) || segtype_is_linear(*segtype)) { - if (seg_from->area_count != 2) { - log_error("Converting %s LV %s to 2 stripes first.", - lvseg_name(seg_from), display_lvname(seg_from->lv)); - *new_image_count = 2; -- seg_flag = SEG_RAID5_N; -+ *segtype = seg_from->segtype; -+ seg_flag = 0; - } else - seg_flag = SEG_RAID1; - -- } else if (segtype_is_raid1(*segtype) && seg_from->area_count != 2) { -- log_error("Convert %s LV %s to 2 stripes first (i.e. --stripes 1).", -- lvseg_name(seg_from), display_lvname(seg_from->lv)); -- return 0; -- -- } else if (seg_is_raid4(seg_from) && -- (segtype_is_linear(*segtype) || segtype_is_any_raid5(*segtype)) && -- !segtype_is_raid5_n(*segtype)) -- seg_flag = SEG_RAID5_N; -+ } else if (segtype_is_any_raid6(*segtype)) { -+ if (seg_from->area_count < 4) { -+ if (*stripes > 3) -+ *new_image_count = *stripes + seg_from->segtype->parity_devs; -+ else -+ *new_image_count = 4; - -- else if (seg_is_raid5_n(seg_from) && seg_from->area_count == 2) { -- if (*stripes >= 2) { -+ *segtype = seg_from->segtype; - log_error("Converting %s LV %s to %u stripes first.", -- lvseg_name(seg_from), display_lvname(seg_from->lv), *stripes); -+ lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count); -+ -+ } else -+ seg_flag = _raid_seg_flag_5_to_6(seg_from); -+ -+ } else if (segtype_is_striped(*segtype) || segtype_is_raid10(*segtype)) { -+ int change = 0; -+ -+ if (!seg_is_raid5_n(seg_from)) { -+ seg_flag = SEG_RAID5_N; -+ -+ } else if (*stripes > 2 && *stripes != seg_from->area_count - seg_from->segtype->parity_devs) { -+ change = 1; - *new_image_count = *stripes + seg_from->segtype->parity_devs; - seg_flag = SEG_RAID5_N; -- } else { -- log_error("Convert %s LV %s to minimum 3 stripes first (i.e. --stripes 2).", -- lvseg_name(seg_from), display_lvname(seg_from->lv)); -- return 0; -- } -- } else if (seg_is_any_raid5(seg_from) && -- (segtype_is_linear(*segtype) || segtype_is_raid4(*segtype)) && -- !segtype_is_raid5_n(*segtype)) -- seg_flag = SEG_RAID5_N; - -- else if (segtype_is_raid10(*segtype)) { -- if (seg_from->area_count < 3) { -- if (*stripes >= 2) { -- log_error("Converting %s LV %s to %u stripes first.", -- lvseg_name(seg_from), display_lvname(seg_from->lv), *stripes); -- *new_image_count = *stripes + seg_from->segtype->parity_devs; -- seg_flag = SEG_RAID5_N; -- } else { -- log_error("Convert %s LV %s to minimum 3 stripes first (i.e. --stripes 2).", -- lvseg_name(seg_from), display_lvname(seg_from->lv)); -- return 0; -- } -- } else -- seg_flag = seg_is_raid5_n(seg_from) ? SEG_RAID0_META : SEG_RAID5_N; -+ } else if (seg_from->area_count < 3) { -+ change = 1; -+ *new_image_count = 3; -+ seg_flag = SEG_RAID5_N; - -- } else if (segtype_is_any_raid6(*segtype)) { -- if (seg_from->area_count < 4 && -- seg_is_any_raid5(seg_from)) { -- if (*stripes >= 3) { -- log_error("Converting %s LV %s to %u stripes first.", -- lvseg_name(seg_from), display_lvname(seg_from->lv), *stripes); -- *new_image_count = *stripes + seg_from->segtype->parity_devs; -- seg_flag = SEG_RAID5_LS; -- } else { -- log_error("Convert %s LV %s to minimum 4 stripes first (i.e. --stripes 3).", -- lvseg_name(seg_from), display_lvname(seg_from->lv)); -- return 0; -- } -+ } else if (!segtype_is_striped(*segtype)) -+ seg_flag = SEG_RAID0_META; - -- } else if (seg_is_raid4(seg_from) && !segtype_is_raid6_n_6(*segtype)) -- seg_flag = SEG_RAID6_N_6; -- else -- seg_flag = _raid_seg_flag_5_to_6(seg_from); -+ if (change) -+ log_error("Converting %s LV %s to %u stripes first.", -+ lvseg_name(seg_from), display_lvname(seg_from->lv), *new_image_count); - } - -+ /* raid4 -> !raid4/raid5* */ -+ } else if (seg_is_raid4(seg_from) && -+ !segtype_is_raid4(*segtype) && !segtype_is_any_raid5(*segtype)) { -+ seg_flag = SEG_RAID5_N; -+ - /* raid6 -> striped/raid0/raid5/raid10 */ - } else if (seg_is_any_raid6(seg_from)) { - if (segtype_is_raid1(*segtype)) { -@@ -6247,6 +6225,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - } else if (segtype_is_any_raid10(*segtype)) { - seg_flag = seg_is_raid6_n_6(seg_from) ? SEG_RAID0_META : SEG_RAID6_N_6; - -+ } else if (segtype_is_linear(*segtype)) { -+ seg_flag = seg_is_raid6_n_6(seg_from) ? SEG_RAID5_N : SEG_RAID6_N_6; -+ - } else if (segtype_is_striped(*segtype) || segtype_is_any_raid0(*segtype)) { - if (!seg_is_raid6_n_6(seg_from)) - seg_flag = SEG_RAID6_N_6; -@@ -6277,12 +6258,16 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - return 0; - } - -- /* raid10 -> ... */ -- } else if (seg_is_raid10(seg_from) && -- !segtype_is_striped(*segtype) && -- !segtype_is_any_raid0(*segtype)) -- seg_flag = SEG_RAID0_META; -+ } else if (seg_is_raid10(seg_from)) { -+ if (segtype_is_linear(*segtype) || -+ (!segtype_is_striped(*segtype) && -+ !segtype_is_any_raid0(*segtype))) { -+ seg_flag = SEG_RAID0_META; -+ } -+ } - -+ -+ /* raid10 -> ... */ - if (seg_flag) { - if (!(*segtype = get_segtype_from_flag(cmd, seg_flag))) - return_0; -diff --git a/test/shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh b/test/shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh -index f01e7ef..05cb616 100644 ---- a/test/shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh -+++ b/test/shell/lvconvert-raid-reshape-linear_to_raid6-single-type.sh -@@ -78,6 +78,7 @@ check lv_first_seg_field $vg/$lv data_stripes 3 - check lv_first_seg_field $vg/$lv stripesize "64.00k" - check lv_first_seg_field $vg/$lv regionsize "128.00k" - check lv_first_seg_field $vg/$lv reshape_len_le 0 -+aux wait_for_sync $vg $lv - - # Convert raid6_ls_6 -> raid6(_zr) (reshape) - lvconvert -y --type raid6 --stripes 3 --stripesize 64K --regionsize 128K $vg/$lv -@@ -88,6 +89,7 @@ check lv_first_seg_field $vg/$lv data_stripes 3 - check lv_first_seg_field $vg/$lv stripesize "64.00k" - check lv_first_seg_field $vg/$lv regionsize "128.00k" - check lv_first_seg_field $vg/$lv reshape_len_le 10 -+aux wait_for_sync $vg $lv - - # Remove reshape space - lvconvert -y --type raid6 --stripes 3 --stripesize 64K --regionsize 128K $vg/$lv --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-lvconvert-fix-direct-raid0-to-striped-conversion.patch b/SOURCES/lvm2-2_02_182-lvconvert-fix-direct-raid0-to-striped-conversion.patch deleted file mode 100644 index c07dcaa..0000000 --- a/SOURCES/lvm2-2_02_182-lvconvert-fix-direct-raid0-to-striped-conversion.patch +++ /dev/null @@ -1,62 +0,0 @@ - WHATS_NEW | 1 + - lib/metadata/raid_manip.c | 3 +++ - test/shell/lvconvert-raid0-striped.sh | 25 +++++++++++++++++++++++++ - 3 files changed, 29 insertions(+) - create mode 100644 test/shell/lvconvert-raid0-striped.sh - -diff --git a/WHATS_NEW b/WHATS_NEW -index 6560357..e3eee56 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.182 - - ============================== -+ Fix lvconvert raid0/raid0_meta -> striped regression. - Fix lvconvert --splitmirror for mirror type (2.02.178). - Do not pair cache policy and cache metadata format. - -diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c -index 705a7f9..804f78b 100644 ---- a/lib/metadata/raid_manip.c -+++ b/lib/metadata/raid_manip.c -@@ -6136,6 +6136,9 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - if (seg_from->area_count == 1) - seg_flag = SEG_RAID1; - -+ else if (seg_is_any_raid0(seg_from) && segtype_is_striped(*segtype)) -+ ; -+ - /* If this is any raid5 conversion request -> enforce raid5_n, because we convert from striped */ - else if (((segtype_is_striped(*segtype) && !segtype_is_any_raid0(*segtype)) || segtype_is_any_raid5(*segtype)) && - !segtype_is_raid5_n(*segtype)) -diff --git a/test/shell/lvconvert-raid0-striped.sh b/test/shell/lvconvert-raid0-striped.sh -new file mode 100644 -index 0000000..4521b34 ---- /dev/null -+++ b/test/shell/lvconvert-raid0-striped.sh -@@ -0,0 +1,25 @@ -+#!/usr/bin/env bash -+ -+# Copyright (C) 2018 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 -+ -+ -+SKIP_WITH_LVMPOLLD=1 -+ -+. lib/inittest -+ -+aux have_raid 1 7 0 || skip -+ -+aux prepare_vg 3 16 -+ -+lvcreate -aey --type raid0 -i 3 -l3 -n $lv $vg -+lvconvert -y --type striped $vg/$lv -+check lv_field $vg/$lv segtype "striped" -+vgremove -ff $vg diff --git a/SOURCES/lvm2-2_02_182-lvconvert-fix-interim-segtype-regression-on-raid6-co.patch b/SOURCES/lvm2-2_02_182-lvconvert-fix-interim-segtype-regression-on-raid6-co.patch deleted file mode 100644 index 32ad471..0000000 --- a/SOURCES/lvm2-2_02_182-lvconvert-fix-interim-segtype-regression-on-raid6-co.patch +++ /dev/null @@ -1,93 +0,0 @@ -From 2ee0f6d4ddd6c602def295e3b1dfccbd8a50a4c8 Mon Sep 17 00:00:00 2001 -From: Heinz Mauelshagen -Date: Fri, 7 Sep 2018 13:48:13 +0200 -Subject: [PATCH] lvconvert: fix interim segtype regression on raid6 - conversions - -When converting from striped/raid0/raid0_meta -to raid6 with > 2 stripes, allow possible -direct conversion (to raid6_n_6). - -In case of 2 stripes, first convert to raid5_n to restripe -to at least 3 data stripes (the raid6 minimum in lvm2) in -a second conversion before finally converting to raid6_n_6. - -As before, raid6_n_6 then can be converted -to any other raid6 layout. - -Enhance lvconvert-raid-takeover.sh to test the -2 stripes conversions to raid6. - -Resolves: rhbz1624038 -(cherry picked from commit e2e30a64ab10602951443dfbd3481bd6b32f5459) - -Conflicts: - WHATS_NEW - -(cherry picked from commit c26bde42af0930bef2cee95c76951285d801ba70) ---- - WHATS_NEW | 1 + - lib/metadata/raid_manip.c | 6 +++--- - test/shell/lvconvert-raid-takeover.sh | 16 ++++++++++++---- - 3 files changed, 16 insertions(+), 7 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 9da40b6..d8a24b0 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.182 - - ============================== -+ Fix lvconvert striped/raid0/raid0_meta -> raid6 regression. - Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. - Fix lvconvert conversion attempts to linear. - Fix lvconvert raid0/raid0_meta -> striped regression. -diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c -index 3eee77a..cb7202a 100644 ---- a/lib/metadata/raid_manip.c -+++ b/lib/metadata/raid_manip.c -@@ -6137,10 +6137,10 @@ static int _set_convenient_raid145610_segtype_to(const struct lv_segment *seg_fr - /* striped/raid0 -> */ - } else if (seg_is_striped(seg_from) || seg_is_any_raid0(seg_from)) { - if (segtype_is_any_raid6(*segtype)) -- seg_flag = SEG_RAID6_N_6; -+ seg_flag = seg_from->area_count < 3 ? SEG_RAID5_N : SEG_RAID6_N_6; - -- if (segtype_is_linear(*segtype) || -- (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) -+ else if (segtype_is_linear(*segtype) || -+ (!segtype_is_raid4(*segtype) && !segtype_is_raid10(*segtype) && !segtype_is_striped(*segtype))) - seg_flag = SEG_RAID5_N; - - /* raid1 -> */ -diff --git a/test/shell/lvconvert-raid-takeover.sh b/test/shell/lvconvert-raid-takeover.sh -index d1c5d30..d22c11b 100644 ---- a/test/shell/lvconvert-raid-takeover.sh -+++ b/test/shell/lvconvert-raid-takeover.sh -@@ -108,11 +108,19 @@ function _invalid_raid5_conversions - not _lvconvert raid6 raid6_n_6 4 6 $vg $lv1 - } - --# Check raid6 conversion constrainst of minimum 3 stripes --_lvcreate striped 2 2 4m $vg $lv1 --not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1 --lvremove -y $vg -+# Check raid6 conversion constrainst for 2 stripes -+for type in striped raid0 raid0_meta -+do -+ _lvcreate $type 2 2 4m $vg $lv1 -+ not _lvconvert raid6 raid6_n_6 2 4 $vg $lv1 -+ _lvconvert raid6 raid5_n 2 3 $vg $lv1 -+ _lvconvert raid6 raid5_n 3 4 $vg $lv1 -+ _lvconvert raid6 raid6_n_6 3 5 $vg $lv1 -+ lvremove -y $vg -+done - -+ -+# Check raid6 conversion constrainst of minimum 3 stripes - _lvcreate raid0 3 3 4m $vg $lv1 - _lvconvert raid6 raid6_n_6 3 5 $vg $lv1 - lvremove -y $vg --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-metadata-prevent-writing-beyond-metadata-area.patch b/SOURCES/lvm2-2_02_182-metadata-prevent-writing-beyond-metadata-area.patch deleted file mode 100644 index 4763114..0000000 --- a/SOURCES/lvm2-2_02_182-metadata-prevent-writing-beyond-metadata-area.patch +++ /dev/null @@ -1,338 +0,0 @@ -From 87bd4a350468023b14251b9bde98f88ffb419268 Mon Sep 17 00:00:00 2001 -From: David Teigland -Date: Mon, 29 Oct 2018 11:06:00 -0500 -Subject: [PATCH 2/2] metadata: prevent writing beyond metadata area - -lvm uses a bcache block size of 128K. A bcache block -at the end of the metadata area will overlap the PEs -from which LVs are allocated. How much depends on -alignments. When lvm reads and writes one of these -bcache blocks to update VG metadata, it can also be -reading and writing PEs that belong to an LV. - -If these overlapping PEs are being written to by the -LV user (e.g. filesystem) at the same time that lvm -is modifying VG metadata in the overlapping bcache -block, then the user's updates to the PEs can be lost. - -This patch is a quick hack to prevent lvm from writing -past the end of the metadata area. - -(cherry picked from commit ab27d5dc2a5c3bf23ab8fed438f1542015dc723d) ---- - lib/device/bcache.c | 79 +++++++++++++++++++++++++++++++++++++++++-- - lib/device/bcache.h | 3 ++ - lib/format_text/format-text.c | 10 ++++++ - lib/label/label.c | 35 ++++++++++++++++++- - lib/label/label.h | 2 ++ - lib/metadata/mirror.c | 4 +++ - 6 files changed, 130 insertions(+), 3 deletions(-) - -diff --git a/lib/device/bcache.c b/lib/device/bcache.c -index b1f7d2a..5ac2558 100644 ---- a/lib/device/bcache.c -+++ b/lib/device/bcache.c -@@ -156,6 +156,10 @@ static void _async_destroy(struct io_engine *ioe) - dm_free(e); - } - -+static int _last_byte_fd; -+static uint64_t _last_byte_offset; -+static int _last_byte_sector_size; -+ - static bool _async_issue(struct io_engine *ioe, enum dir d, int fd, - sector_t sb, sector_t se, void *data, void *context) - { -@@ -163,12 +167,53 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd, - struct iocb *cb_array[1]; - struct control_block *cb; - struct async_engine *e = _to_async(ioe); -+ sector_t offset; -+ sector_t nbytes; -+ sector_t limit_nbytes; -+ sector_t extra_nbytes = 0; - - if (((uintptr_t) data) & e->page_mask) { - log_warn("misaligned data buffer"); - return false; - } - -+ offset = sb << SECTOR_SHIFT; -+ nbytes = (se - sb) << SECTOR_SHIFT; -+ -+ /* -+ * If bcache block goes past where lvm wants to write, then clamp it. -+ */ -+ if ((d == DIR_WRITE) && _last_byte_offset && (fd == _last_byte_fd)) { -+ if (offset > _last_byte_offset) { -+ log_error("Limit write at %llu len %llu beyond last byte %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)_last_byte_offset); -+ return false; -+ } -+ -+ if (offset + nbytes > _last_byte_offset) { -+ limit_nbytes = _last_byte_offset - offset; -+ if (limit_nbytes % _last_byte_sector_size) -+ extra_nbytes = _last_byte_sector_size - (limit_nbytes % _last_byte_sector_size); -+ -+ if (extra_nbytes) { -+ log_debug("Limit write at %llu len %llu to len %llu rounded to %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)limit_nbytes, -+ (unsigned long long)(limit_nbytes + extra_nbytes)); -+ nbytes = limit_nbytes + extra_nbytes; -+ } else { -+ log_debug("Limit write at %llu len %llu to len %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)limit_nbytes); -+ nbytes = limit_nbytes; -+ } -+ } -+ } -+ - cb = _cb_alloc(e->cbs, context); - if (!cb) { - log_warn("couldn't allocate control block"); -@@ -179,10 +224,22 @@ static bool _async_issue(struct io_engine *ioe, enum dir d, int fd, - - cb->cb.aio_fildes = (int) fd; - cb->cb.u.c.buf = data; -- cb->cb.u.c.offset = sb << SECTOR_SHIFT; -- cb->cb.u.c.nbytes = (se - sb) << SECTOR_SHIFT; -+ cb->cb.u.c.offset = offset; -+ cb->cb.u.c.nbytes = nbytes; - cb->cb.aio_lio_opcode = (d == DIR_READ) ? IO_CMD_PREAD : IO_CMD_PWRITE; - -+#if 0 -+ if (d == DIR_READ) { -+ log_debug("io R off %llu bytes %llu", -+ (unsigned long long)cb->cb.u.c.offset, -+ (unsigned long long)cb->cb.u.c.nbytes); -+ } else { -+ log_debug("io W off %llu bytes %llu", -+ (unsigned long long)cb->cb.u.c.offset, -+ (unsigned long long)cb->cb.u.c.nbytes); -+ } -+#endif -+ - cb_array[0] = &cb->cb; - do { - r = io_submit(e->aio_context, 1, cb_array); -@@ -1145,3 +1202,21 @@ bool bcache_invalidate_fd(struct bcache *cache, int fd) - - //---------------------------------------------------------------- - -+void bcache_set_last_byte(struct bcache *cache, int fd, uint64_t offset, int sector_size) -+{ -+ _last_byte_fd = fd; -+ _last_byte_offset = offset; -+ _last_byte_sector_size = sector_size; -+ if (!sector_size) -+ _last_byte_sector_size = 512; -+} -+ -+void bcache_unset_last_byte(struct bcache *cache, int fd) -+{ -+ if (_last_byte_fd == fd) { -+ _last_byte_fd = 0; -+ _last_byte_offset = 0; -+ _last_byte_sector_size = 0; -+ } -+} -+ -diff --git a/lib/device/bcache.h b/lib/device/bcache.h -index b0aebb4..cb902ef 100644 ---- a/lib/device/bcache.h -+++ b/lib/device/bcache.h -@@ -158,6 +158,9 @@ bool bcache_write_bytes(struct bcache *cache, int fd, uint64_t start, size_t len - bool bcache_zero_bytes(struct bcache *cache, int fd, uint64_t start, size_t len); - bool bcache_set_bytes(struct bcache *cache, int fd, uint64_t start, size_t len, uint8_t val); - -+void bcache_set_last_byte(struct bcache *cache, int fd, uint64_t offset, int sector_size); -+void bcache_unset_last_byte(struct bcache *cache, int fd); -+ - //---------------------------------------------------------------- - - #endif -diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c -index 792d75a..36afba1 100644 ---- a/lib/format_text/format-text.c -+++ b/lib/format_text/format-text.c -@@ -400,10 +400,14 @@ static int _raw_write_mda_header(const struct format_type *fmt, - MDA_HEADER_SIZE - - sizeof(mdah->checksum_xl))); - -+ dev_set_last_byte(dev, start_byte + MDA_HEADER_SIZE); -+ - if (!dev_write_bytes(dev, start_byte, MDA_HEADER_SIZE, mdah)) { -+ dev_unset_last_byte(dev); - log_error("Failed to write mda header to %s fd %d", dev_name(dev), dev->bcache_fd); - return 0; - } -+ dev_unset_last_byte(dev); - - return 1; - } -@@ -677,10 +681,13 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg, - (unsigned long long)(mdac->rlocn.size - new_wrap), - (unsigned long long)new_wrap); - -+ dev_set_last_byte(mdac->area.dev, mdac->area.start + mdah->size); -+ - if (!dev_write_bytes(mdac->area.dev, mdac->area.start + mdac->rlocn.offset, - (size_t) (mdac->rlocn.size - new_wrap), - fidtc->raw_metadata_buf)) { - log_error("Failed to write metadata to %s fd %d", dev_name(mdac->area.dev), mdac->area.dev->bcache_fd); -+ dev_unset_last_byte(mdac->area.dev); - goto out; - } - -@@ -694,10 +701,13 @@ static int _vg_write_raw(struct format_instance *fid, struct volume_group *vg, - (size_t) new_wrap, - fidtc->raw_metadata_buf + mdac->rlocn.size - new_wrap)) { - log_error("Failed to write metadata wrap to %s fd %d", dev_name(mdac->area.dev), mdac->area.dev->bcache_fd); -+ dev_unset_last_byte(mdac->area.dev); - goto out; - } - } - -+ dev_unset_last_byte(mdac->area.dev); -+ - mdac->rlocn.checksum = calc_crc(INITIAL_CRC, (uint8_t *)fidtc->raw_metadata_buf, - (uint32_t) (mdac->rlocn.size - - new_wrap)); -diff --git a/lib/label/label.c b/lib/label/label.c -index bafa543..d2cfe62 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -172,6 +172,7 @@ int label_write(struct device *dev, struct label *label) - { - char buf[LABEL_SIZE] __attribute__((aligned(8))); - struct label_header *lh = (struct label_header *) buf; -+ uint64_t offset; - int r = 1; - - if (!label->labeller->ops->write) { -@@ -206,11 +207,17 @@ int label_write(struct device *dev, struct label *label) - return 0; - } - -- if (!dev_write_bytes(dev, label->sector << SECTOR_SHIFT, LABEL_SIZE, buf)) { -+ offset = label->sector << SECTOR_SHIFT; -+ -+ dev_set_last_byte(dev, offset + LABEL_SIZE); -+ -+ if (!dev_write_bytes(dev, offset, LABEL_SIZE, buf)) { - log_debug_devs("Failed to write label to %s", dev_name(dev)); - r = 0; - } - -+ dev_unset_last_byte(dev); -+ - return r; - } - -@@ -1256,9 +1263,12 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len) - } - } - -+ dev_set_last_byte(dev, start + len); -+ - if (!bcache_zero_bytes(scan_bcache, dev->bcache_fd, start, len)) { - log_error("Error writing device %s at %llu length %u.", - dev_name(dev), (unsigned long long)start, (uint32_t)len); -+ dev_unset_last_byte(dev); - label_scan_invalidate(dev); - return false; - } -@@ -1266,9 +1276,11 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len) - if (!bcache_flush(scan_bcache)) { - log_error("Error writing device %s at %llu length %u.", - dev_name(dev), (unsigned long long)start, (uint32_t)len); -+ dev_unset_last_byte(dev); - label_scan_invalidate(dev); - return false; - } -+ dev_unset_last_byte(dev); - return true; - } - -@@ -1302,9 +1314,12 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val) - } - } - -+ dev_set_last_byte(dev, start + len); -+ - if (!bcache_set_bytes(scan_bcache, dev->bcache_fd, start, len, val)) { - log_error("Error writing device %s at %llu length %u.", - dev_name(dev), (unsigned long long)start, (uint32_t)len); -+ dev_unset_last_byte(dev); - label_scan_invalidate(dev); - return false; - } -@@ -1312,9 +1327,27 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val) - if (!bcache_flush(scan_bcache)) { - log_error("Error writing device %s at %llu length %u.", - dev_name(dev), (unsigned long long)start, (uint32_t)len); -+ dev_unset_last_byte(dev); - label_scan_invalidate(dev); - return false; - } -+ -+ dev_unset_last_byte(dev); - return true; - } - -+void dev_set_last_byte(struct device *dev, uint64_t offset) -+{ -+ unsigned int phys_block_size = 0; -+ unsigned int block_size = 0; -+ -+ dev_get_block_size(dev, &phys_block_size, &block_size); -+ -+ bcache_set_last_byte(scan_bcache, dev->bcache_fd, offset, phys_block_size); -+} -+ -+void dev_unset_last_byte(struct device *dev) -+{ -+ bcache_unset_last_byte(scan_bcache, dev->bcache_fd); -+} -+ -diff --git a/lib/label/label.h b/lib/label/label.h -index 5ed8bc8..e2b8263 100644 ---- a/lib/label/label.h -+++ b/lib/label/label.h -@@ -125,5 +125,7 @@ bool dev_read_bytes(struct device *dev, uint64_t start, size_t len, void *data); - bool dev_write_bytes(struct device *dev, uint64_t start, size_t len, void *data); - bool dev_write_zeros(struct device *dev, uint64_t start, size_t len); - bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val); -+void dev_set_last_byte(struct device *dev, uint64_t offset); -+void dev_unset_last_byte(struct device *dev); - - #endif -diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c -index c7d8a9e..b1dcaa0 100644 ---- a/lib/metadata/mirror.c -+++ b/lib/metadata/mirror.c -@@ -302,10 +302,14 @@ static int _write_log_header(struct cmd_context *cmd, struct logical_volume *lv) - return 0; - } - -+ dev_set_last_byte(dev, sizeof(log_header)); -+ - if (!dev_write_bytes(dev, UINT64_C(0), sizeof(log_header), &log_header)) { -+ dev_unset_last_byte(dev); - log_error("Failed to write log header to %s.", name); - return 0; - } -+ dev_unset_last_byte(dev); - - label_scan_invalidate(dev); - --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-mirror-fix-splitmirrors-for-mirror-type.patch b/SOURCES/lvm2-2_02_182-mirror-fix-splitmirrors-for-mirror-type.patch deleted file mode 100644 index 9c2e3ea..0000000 --- a/SOURCES/lvm2-2_02_182-mirror-fix-splitmirrors-for-mirror-type.patch +++ /dev/null @@ -1,45 +0,0 @@ - WHATS_NEW | 1 + - lib/activate/activate.c | 5 +++++ - lib/metadata/mirror.c | 2 +- - 3 files changed, 7 insertions(+), 1 deletion(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 17aff08..6560357 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.182 - - ============================== -+ Fix lvconvert --splitmirror for mirror type (2.02.178). - Do not pair cache policy and cache metadata format. - - Version 2.02.181 - -diff --git a/lib/activate/activate.c b/lib/activate/activate.c -index e38ab03..16704f6 100644 ---- a/lib/activate/activate.c -+++ b/lib/activate/activate.c -@@ -2125,6 +2125,11 @@ static int _preload_detached_lv(struct logical_volume *lv, void *data) - !lv_is_raid_metadata(lv_pre) && lv_is_active(lv) && - !_lv_preload(lv_pre, detached->laopts, detached->flush_required)) - return_0; -+ } else if (lv_is_mirror_image(lv)) { -+ if ((lv_pre = find_lv_in_vg_by_lvid(detached->lv_pre->vg, &lv->lvid)) && -+ !lv_is_mirror_image(lv_pre) && lv_is_active(lv) && -+ !_lv_preload(lv_pre, detached->laopts, detached->flush_required)) -+ return_0; - } - - if (!lv_is_visible(lv) && (lv_pre = find_lv(detached->lv_pre->vg, lv->name)) && -diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c -index 7f38d4f..c7d8a9e 100644 ---- a/lib/metadata/mirror.c -+++ b/lib/metadata/mirror.c -@@ -786,7 +786,7 @@ static int _split_mirror_images(struct logical_volume *lv, - - act = lv_is_active(lv_lock_holder(lv)); - -- if (act && !_activate_lv_like_model(lv, new_lv)) { -+ if (act && (!deactivate_lv(cmd, new_lv) || !_activate_lv_like_model(lv, new_lv))) { - log_error("Failed to rename newly split LV in the kernel"); - return 0; - } diff --git a/SOURCES/lvm2-2_02_182-mirrors-fix-read_only_volume_list.patch b/SOURCES/lvm2-2_02_182-mirrors-fix-read_only_volume_list.patch deleted file mode 100644 index 885d995..0000000 --- a/SOURCES/lvm2-2_02_182-mirrors-fix-read_only_volume_list.patch +++ /dev/null @@ -1,16 +0,0 @@ - lib/activate/activate.c | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/lib/activate/activate.c b/lib/activate/activate.c -index 18f4b84..e38ab03 100644 ---- a/lib/activate/activate.c -+++ b/lib/activate/activate.c -@@ -1864,6 +1864,8 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume - - if (!laopts) - laopts = &zlaopts; -+ else -+ mirr_laopts.read_only = laopts->read_only; - - /* skip dmeventd code altogether */ - if (dmeventd_monitor_mode() == DMEVENTD_MONITOR_IGNORE) diff --git a/SOURCES/lvm2-2_02_182-scan-enable-full-md-filter-when-md-1.0-devices-are-p.patch b/SOURCES/lvm2-2_02_182-scan-enable-full-md-filter-when-md-1.0-devices-are-p.patch deleted file mode 100644 index ec9b960..0000000 --- a/SOURCES/lvm2-2_02_182-scan-enable-full-md-filter-when-md-1.0-devices-are-p.patch +++ /dev/null @@ -1,115 +0,0 @@ - lib/filters/filter-md.c | 33 +++++++-------------------------- - lib/label/label.c | 13 ++++++++++++- - 2 files changed, 19 insertions(+), 27 deletions(-) - -diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c -index ad5b8e4..e03ff50 100644 ---- a/lib/filters/filter-md.c -+++ b/lib/filters/filter-md.c -@@ -16,6 +16,9 @@ - #include "lib.h" - #include "filter.h" - -+/* See label.c comment about this hack. */ -+extern int use_full_md_check; -+ - #ifdef __linux__ - - #define MSG_SKIPPING "%s: Skipping md component device" -@@ -80,7 +83,7 @@ - * that will not pass. - */ - --static int _passes_md_filter(struct device *dev, int full) -+static int _passes_md_filter(struct dev_filter *f, struct device *dev) - { - int ret; - -@@ -91,7 +94,7 @@ static int _passes_md_filter(struct device *dev, int full) - if (!md_filtering()) - return 1; - -- ret = dev_is_md(dev, NULL, full); -+ ret = dev_is_md(dev, NULL, use_full_md_check); - - if (ret == -EAGAIN) { - /* let pass, call again after scan */ -@@ -104,6 +107,7 @@ static int _passes_md_filter(struct device *dev, int full) - return 1; - - if (ret == 1) { -+ log_debug_devs("md filter full %d excluding md component %s", use_full_md_check, dev_name(dev)); - if (dev->ext.src == DEV_EXT_NONE) - log_debug_devs(MSG_SKIPPING, dev_name(dev)); - else -@@ -121,18 +125,6 @@ static int _passes_md_filter(struct device *dev, int full) - return 1; - } - --static int _passes_md_filter_lite(struct dev_filter *f __attribute__((unused)), -- struct device *dev) --{ -- return _passes_md_filter(dev, 0); --} -- --static int _passes_md_filter_full(struct dev_filter *f __attribute__((unused)), -- struct device *dev) --{ -- return _passes_md_filter(dev, 1); --} -- - static void _destroy(struct dev_filter *f) - { - if (f->use_count) -@@ -150,18 +142,7 @@ struct dev_filter *md_filter_create(struct cmd_context *cmd, struct dev_types *d - return NULL; - } - -- /* -- * FIXME: for commands that want a full md check (pvcreate, vgcreate, -- * vgextend), we do an extra read at the end of every device that the -- * filter looks at. This isn't necessary; we only need to do the full -- * md check on the PVs that these commands are trying to use. -- */ -- -- if (cmd->use_full_md_check) -- f->passes_filter = _passes_md_filter_full; -- else -- f->passes_filter = _passes_md_filter_lite; -- -+ f->passes_filter = _passes_md_filter; - f->destroy = _destroy; - f->use_count = 0; - f->private = dt; -diff --git a/lib/label/label.c b/lib/label/label.c -index 6fb35ff..03726d0 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -27,6 +27,7 @@ - #include - #include - -+int use_full_md_check; - - /* FIXME Allow for larger labels? Restricted to single sector currently */ - -@@ -884,8 +885,18 @@ int label_scan(struct cmd_context *cmd) - * devs in 'pvs', which is a pretty harmless effect from a - * pretty uncommon situation. - */ -- if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) -+ if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) { - cmd->use_full_md_check = 1; -+ -+ /* This is a hack because 'cmd' is not passed -+ into the filters so we can't check the flag -+ in the cmd struct. The master branch has -+ changed the filters in commit 8eab37593eccb -+ to accept cmd, but it's a complex change -+ that I'm trying to avoid in the stable branch. */ -+ -+ use_full_md_check = 1; -+ } - }; - dev_iter_destroy(iter); - diff --git a/SOURCES/lvm2-2_02_182-scan-use-full-md-filter-when-md-1.0-devices-are-pres.patch b/SOURCES/lvm2-2_02_182-scan-use-full-md-filter-when-md-1.0-devices-are-pres.patch deleted file mode 100644 index 03d3546..0000000 --- a/SOURCES/lvm2-2_02_182-scan-use-full-md-filter-when-md-1.0-devices-are-pres.patch +++ /dev/null @@ -1,201 +0,0 @@ - lib/cache/lvmcache.c | 2 +- - lib/device/dev-md.c | 27 ++++++++++---- - lib/device/dev-type.h | 1 + - lib/filters/filter-md.c | 74 +++++++++++++++++++------------------- - lib/label/label.c | 14 ++++++++ - test/shell/pvcreate-md-fake-hdr.sh | 3 +- - 6 files changed, 75 insertions(+), 46 deletions(-) - -diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c -index 2fba3ff..f55a14c 100644 ---- a/lib/cache/lvmcache.c -+++ b/lib/cache/lvmcache.c -@@ -1002,7 +1002,7 @@ int lvmcache_dev_is_unchosen_duplicate(struct device *dev) - * unused_duplicate_devs list, and restrict what we allow done with it. - * - * In the case of md components, we usually filter these out in filter-md, -- * but in the special case of md superblocks <= 1.0 where the superblock -+ * but in the special case of md superblock version 1.0 where the superblock - * is at the end of the device, filter-md doesn't always eliminate them - * first, so we eliminate them here. - * -diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c -index f5a736f..7196dc0 100644 ---- a/lib/device/dev-md.c -+++ b/lib/device/dev-md.c -@@ -142,13 +142,6 @@ static int _native_dev_is_md(struct device *dev, uint64_t *offset_found, int ful - * command if it should do a full check (cmd->use_full_md_check), - * and set it for commands that could possibly write to an md dev - * (pvcreate/vgcreate/vgextend). -- * -- * For old md versions with magic numbers at the end of devices, -- * the md dev components won't be filtered out here when full is 0, -- * so they will be scanned, and appear as duplicate PVs in lvmcache. -- * The md device itself will be chosen as the primary duplicate, -- * and the components are dropped from the list of duplicates in, -- * i.e. a kind of post-scan filtering. - */ - if (!full) { - sb_offset = 0; -@@ -414,6 +407,26 @@ unsigned long dev_md_stripe_width(struct dev_types *dt, struct device *dev) - return stripe_width_sectors; - } - -+int dev_is_md_with_end_superblock(struct dev_types *dt, struct device *dev) -+{ -+ char version_string[MD_MAX_SYSFS_SIZE]; -+ const char *attribute = "metadata_version"; -+ -+ if (MAJOR(dev->dev) != dt->md_major) -+ return 0; -+ -+ if (_md_sysfs_attribute_scanf(dt, dev, attribute, -+ "%s", &version_string) != 1) -+ return -1; -+ -+ log_very_verbose("Device %s %s is %s.", -+ dev_name(dev), attribute, version_string); -+ -+ if (!strcmp(version_string, "1.0")) -+ return 1; -+ return 0; -+} -+ - #else - - int dev_is_md(struct device *dev __attribute__((unused)), -diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h -index 843e254..f629a02 100644 ---- a/lib/device/dev-type.h -+++ b/lib/device/dev-type.h -@@ -76,6 +76,7 @@ int wipe_known_signatures(struct cmd_context *cmd, struct device *dev, const cha - - /* Type-specific device properties */ - unsigned long dev_md_stripe_width(struct dev_types *dt, struct device *dev); -+int dev_is_md_with_end_superblock(struct dev_types *dt, struct device *dev); - - /* Partitioning */ - int major_max_partitions(struct dev_types *dt, int major); -diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c -index ab97b59..ad5b8e4 100644 ---- a/lib/filters/filter-md.c -+++ b/lib/filters/filter-md.c -@@ -29,43 +29,43 @@ - * - * (This is assuming lvm.conf md_component_detection=1.) - * -- * If lvm does *not* ignore the components, then lvm will read lvm -- * labels from the md dev and from the component devs, and will see -- * them all as duplicates of each other. LVM duplicate resolution -- * will then kick in and keep the md dev around to use and ignore -- * the components. -- * -- * It is better to exclude the components as early as possible during -- * lvm processing, ideally before lvm even looks for labels on the -- * components, so that duplicate resolution can be avoided. There are -- * a number of ways that md components can be excluded earlier than -- * the duplicate resolution phase: -- * -- * - When external_device_info_source="udev", lvm discovers a device is -- * an md component by asking udev during the initial filtering phase. -- * However, lvm's default is to not use udev for this. The -- * alternative is "native" detection in which lvm tries to detect -- * md components itself. -- * -- * - When using native detection, lvm's md filter looks for the md -- * superblock at the start of devices. It will see the md superblock -- * on the components, exclude them in the md filter, and avoid -- * handling them later in duplicate resolution. -- * -- * - When using native detection, lvm's md filter will not detect -- * components when the md device has an older superblock version that -- * places the superblock at the end of the device. This case will -- * fall back to duplicate resolution to exclude components. -- * -- * A variation of the description above occurs for lvm commands that -- * intend to create new PVs on devices (pvcreate, vgcreate, vgextend). -- * For these commands, the native md filter also reads the end of all -- * devices to check for the odd md superblocks. -- * -- * (The reason that external_device_info_source is not set to udev by -- * default is that there have be issues with udev not being promptly -- * or reliably updated about md state changes, causing the udev info -- * that lvm uses to be occasionally wrong.) -+ * If lvm does *not* ignore the components, then lvm may read lvm -+ * labels from the component devs and potentially the md dev, -+ * which can trigger duplicate detection, and/or cause lvm to display -+ * md components as PVs rather than ignoring them. -+ * -+ * If scanning md componenents causes duplicates to be seen, then -+ * the lvm duplicate resolution will exclude the components. -+ * -+ * The lvm md filter has three modes: -+ * -+ * 1. look for md superblock at the start of the device -+ * 2. look for md superblock at the start and end of the device -+ * 3. use udev to detect components -+ * -+ * mode 1 will not detect and exclude components of md devices -+ * that use superblock version 1.0 which is at the end of the device. -+ * -+ * mode 2 will detect these, but mode 2 doubles the i/o done by label -+ * scan, since there's a read at both the start and end of every device. -+ * -+ * mode 3 is used when external_device_info_source="udev". It does -+ * not require any io from lvm, but this mode is not used by default -+ * because there have been problems getting reliable info from udev. -+ * -+ * lvm uses mode 2 when: -+ * -+ * - the command is pvcreate/vgcreate/vgextend, which format new -+ * devices, and if the user ran these commands on a component -+ * device of an md device 1.0, then it would cause problems. -+ * FIXME: this would only really need to scan the end of the -+ * devices being formatted, not all devices. -+ * -+ * - it sees an md device on the system using version 1.0. -+ * The point of this is just to avoid displaying md components -+ * from the 'pvs' command. -+ * FIXME: the cost (double i/o) may not be worth the benefit -+ * (not showing md components). - */ - - /* -diff --git a/lib/label/label.c b/lib/label/label.c -index e7e3997..6fb35ff 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -872,6 +872,20 @@ int label_scan(struct cmd_context *cmd) - bcache_invalidate_fd(scan_bcache, dev->bcache_fd); - _scan_dev_close(dev); - } -+ -+ /* -+ * When md devices exist that use the old superblock at the -+ * end of the device, then in order to detect and filter out -+ * the component devices of those md devs, we need to enable -+ * the full md filter which scans both the start and the end -+ * of every device. This doubles the amount of scanning i/o, -+ * which we want to avoid. FIXME: it may not be worth the -+ * cost of double i/o just to avoid displaying md component -+ * devs in 'pvs', which is a pretty harmless effect from a -+ * pretty uncommon situation. -+ */ -+ if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) -+ cmd->use_full_md_check = 1; - }; - dev_iter_destroy(iter); - -diff --git a/test/shell/pvcreate-md-fake-hdr.sh b/test/shell/pvcreate-md-fake-hdr.sh -index b89fe43..4c9ac7c 100644 ---- a/test/shell/pvcreate-md-fake-hdr.sh -+++ b/test/shell/pvcreate-md-fake-hdr.sh -@@ -89,6 +89,7 @@ sleep 1 - # (when mdadm supports repair) - if mdadm --action=repair "$mddev" ; then - sleep 1 -+ pvscan -vvvv - # should be showing correctly PV3 & PV4 -- pvs -+ pvs -vvvv "$dev3" "$dev4" - fi diff --git a/SOURCES/lvm2-2_02_182-scripts-add-After-rbdmap.service-to-lvm2-activation.patch b/SOURCES/lvm2-2_02_182-scripts-add-After-rbdmap.service-to-lvm2-activation.patch deleted file mode 100644 index cc2f209..0000000 --- a/SOURCES/lvm2-2_02_182-scripts-add-After-rbdmap.service-to-lvm2-activation.patch +++ /dev/null @@ -1,73 +0,0 @@ -From 4484518f67dd41151571e0841ef13134abe39408 Mon Sep 17 00:00:00 2001 -From: Peter Rajnoha -Date: Thu, 30 Aug 2018 12:35:58 +0200 -Subject: [PATCH 2/2] scripts: add After=rbdmap.service to - {lvm2-activation-net,blk-availability}.service - -We need to have Ceph RBD devices mapped first before use in a stack -where LVM is on top so make sure rbdmap.service is called before -generated lvm2-activation-net.service. - -On shutdown, we need to stop blk-availability first before we stop the -rbdmap.service. - -Resolves: rhbz1623479 -(cherry picked from commit cb17ef221bdefea3625a22c19c6d8f5504441771) - -Conflicts: - WHATS_NEW - -(cherry picked from commit 3374a592502ef099d38491b0c2020a6945d825b1) - -Conflicts: - WHATS_NEW ---- - WHATS_NEW | 2 ++ - scripts/blk_availability_systemd_red_hat.service.in | 2 +- - scripts/lvm2_activation_generator_systemd_red_hat.c | 2 +- - 3 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 92e5c04..9da40b6 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,9 +1,11 @@ - Version 2.02.182 - - ============================== -+ Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. - Fix lvconvert conversion attempts to linear. - Fix lvconvert raid0/raid0_meta -> striped regression. - Fix lvconvert --splitmirror for mirror type (2.02.178). - Do not pair cache policy and cache metadata format. -+ Fix mirrors honoring read_only_volume_list. - - Version 2.02.181 - - ================================= -diff --git a/scripts/blk_availability_systemd_red_hat.service.in b/scripts/blk_availability_systemd_red_hat.service.in -index 1198baa..9462072 100644 ---- a/scripts/blk_availability_systemd_red_hat.service.in -+++ b/scripts/blk_availability_systemd_red_hat.service.in -@@ -1,6 +1,6 @@ - [Unit] - Description=Availability of block devices --After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service -+After=lvm2-activation.service lvm2-lvmetad.service iscsi-shutdown.service iscsi.service iscsid.service fcoe.service rbdmap.service - DefaultDependencies=no - Conflicts=shutdown.target - -diff --git a/scripts/lvm2_activation_generator_systemd_red_hat.c b/scripts/lvm2_activation_generator_systemd_red_hat.c -index 0f7f89c..487582f 100644 ---- a/scripts/lvm2_activation_generator_systemd_red_hat.c -+++ b/scripts/lvm2_activation_generator_systemd_red_hat.c -@@ -128,7 +128,7 @@ static int generate_unit(const char *dir, int unit, int sysinit_needed) - "DefaultDependencies=no\n", f); - - if (unit == UNIT_NET) { -- fprintf(f, "After=%s iscsi.service fcoe.service\n" -+ fprintf(f, "After=%s iscsi.service fcoe.service rbdmap.service\n" - "Before=remote-fs-pre.target shutdown.target\n\n" - "[Service]\n" - "ExecStartPre=/usr/bin/udevadm settle\n", unit_names[UNIT_MAIN]); --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_182-vgcreate-close-exclusive-fd-after-pvcreate.patch b/SOURCES/lvm2-2_02_182-vgcreate-close-exclusive-fd-after-pvcreate.patch deleted file mode 100644 index 7a7e060..0000000 --- a/SOURCES/lvm2-2_02_182-vgcreate-close-exclusive-fd-after-pvcreate.patch +++ /dev/null @@ -1,53 +0,0 @@ - lib/label/label.c | 6 +++--- - tools/toollib.c | 7 +++++++ - 2 files changed, 10 insertions(+), 3 deletions(-) - -diff --git a/lib/label/label.c b/lib/label/label.c -index ac37713..bafa543 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -1190,7 +1190,7 @@ bool dev_write_bytes(struct device *dev, uint64_t start, size_t len, void *data) - return false; - } - -- if (!(dev->flags & DEV_BCACHE_WRITE)) { -+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) { - /* FIXME: avoid tossing out bcache blocks just to replace fd. */ - log_debug("Close and reopen to write %s", dev_name(dev)); - bcache_invalidate_fd(scan_bcache, dev->bcache_fd); -@@ -1236,7 +1236,7 @@ bool dev_write_zeros(struct device *dev, uint64_t start, size_t len) - return false; - } - -- if (!(dev->flags & DEV_BCACHE_WRITE)) { -+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) { - /* FIXME: avoid tossing out bcache blocks just to replace fd. */ - log_debug("Close and reopen to write %s", dev_name(dev)); - bcache_invalidate_fd(scan_bcache, dev->bcache_fd); -@@ -1282,7 +1282,7 @@ bool dev_set_bytes(struct device *dev, uint64_t start, size_t len, uint8_t val) - return false; - } - -- if (!(dev->flags & DEV_BCACHE_WRITE)) { -+ if (_in_bcache(dev) && !(dev->flags & DEV_BCACHE_WRITE)) { - /* FIXME: avoid tossing out bcache blocks just to replace fd. */ - log_debug("Close and reopen to write %s", dev_name(dev)); - bcache_invalidate_fd(scan_bcache, dev->bcache_fd); -diff --git a/tools/toollib.c b/tools/toollib.c -index b60ff06..e1c86f9 100644 ---- a/tools/toollib.c -+++ b/tools/toollib.c -@@ -5897,6 +5897,13 @@ do_command: - pd->name); - } - -+ /* -+ * Don't keep devs open excl in bcache because the excl will prevent -+ * using that dev elsewhere. -+ */ -+ dm_list_iterate_items(devl, &rescan_devs) -+ label_scan_invalidate(devl->dev); -+ - dm_list_iterate_items(pd, &pp->arg_fail) - log_debug("%s: command failed for %s.", - cmd->command->name, pd->name); diff --git a/SOURCES/lvm2-2_02_183-WHATS_NEW-sync-io.patch b/SOURCES/lvm2-2_02_183-WHATS_NEW-sync-io.patch deleted file mode 100644 index defd1ec..0000000 --- a/SOURCES/lvm2-2_02_183-WHATS_NEW-sync-io.patch +++ /dev/null @@ -1,19 +0,0 @@ - WHATS_NEW | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/WHATS_NEW b/WHATS_NEW -index a1da4b7..82dd0c8 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,11 @@ -+Version 2.02.183 - -+==================================== -+ Use sync io if async io_setup fails, or use_aio=0 is set in config. -+ - Version 2.02.182 - - ============================== -+ Fix possible write race between last metadata block and the first extent. -+ Fix filtering of md 1.0 devices so they are not seen as duplicate PVs. - Fix change of monitoring in clustered volumes. - Fix lvconvert striped/raid0/raid0_meta -> raid6 regression. - Add After=rbdmap.service to {lvm2-activation-net,blk-availability}.service. diff --git a/SOURCES/lvm2-2_02_183-WHATS_NEW.patch b/SOURCES/lvm2-2_02_183-WHATS_NEW.patch deleted file mode 100644 index ed6ef08..0000000 --- a/SOURCES/lvm2-2_02_183-WHATS_NEW.patch +++ /dev/null @@ -1,30 +0,0 @@ - WHATS_NEW | 3 ++- - WHATS_NEW_DM | 6 +++++- - 2 files changed, 7 insertions(+), 2 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 82dd0c8..47db4a3 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,5 +1,6 @@ - Version 2.02.183 - --==================================== -+===================================== -+ Fix component detection for md version 0.90. - Use sync io if async io_setup fails, or use_aio=0 is set in config. - - Version 2.02.182 - -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index 42cf2a8..bbd1057 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,4 +1,8 @@ --Version 1.02.151 - -+Version 1.02.154 - -+============================== -+ Fix dmstats report printing no output. -+ -+Version 1.02.152 - - ============================== - Add hot fix to avoiding locking collision when monitoring thin-pools. - diff --git a/SOURCES/lvm2-2_02_183-bcache-sync-io-fixes.patch b/SOURCES/lvm2-2_02_183-bcache-sync-io-fixes.patch deleted file mode 100644 index 558d2ab..0000000 --- a/SOURCES/lvm2-2_02_183-bcache-sync-io-fixes.patch +++ /dev/null @@ -1,112 +0,0 @@ - lib/device/bcache.c | 69 ++++++++++++++++++++++++++++++++++++----------------- - 1 file changed, 47 insertions(+), 22 deletions(-) - -diff --git a/lib/device/bcache.c b/lib/device/bcache.c -index 1cb1b2f..6886b74 100644 ---- a/lib/device/bcache.c -+++ b/lib/device/bcache.c -@@ -320,7 +320,7 @@ struct io_engine *create_async_io_engine(void) - e->aio_context = 0; - r = io_setup(MAX_IO, &e->aio_context); - if (r < 0) { -- log_warn("io_setup failed"); -+ log_debug("io_setup failed %d", r); - dm_free(e); - return NULL; - } -@@ -363,8 +363,11 @@ static void _sync_destroy(struct io_engine *ioe) - static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, - sector_t sb, sector_t se, void *data, void *context) - { -- int r; -- uint64_t len = (se - sb) * 512, where; -+ int rv; -+ off_t off; -+ uint64_t where; -+ uint64_t pos = 0; -+ uint64_t len = (se - sb) * 512; - struct sync_engine *e = _to_sync(ioe); - struct sync_io *io = malloc(sizeof(*io)); - if (!io) { -@@ -373,11 +376,17 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, - } - - where = sb * 512; -- r = lseek(fd, where, SEEK_SET); -- if (r < 0) { -- log_warn("unable to seek to position %llu", (unsigned long long) where); -- free(io); -- return false; -+ -+ off = lseek(fd, where, SEEK_SET); -+ if (off == (off_t) -1) { -+ log_warn("Device seek error %d for offset %llu", errno, (unsigned long long)where); -+ free(io); -+ return false; -+ } -+ if (off != (off_t) where) { -+ log_warn("Device seek failed for offset %llu", (unsigned long long)where); -+ free(io); -+ return false; - } - - /* -@@ -422,28 +431,44 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, - len = nbytes; - } - -- while (len) { -- do { -- if (d == DIR_READ) -- r = read(fd, data, len); -- else -- r = write(fd, data, len); -+ while (pos < len) { -+ if (d == DIR_READ) -+ rv = read(fd, (char *)data + pos, len - pos); -+ else -+ rv = write(fd, (char *)data + pos, len - pos); - -- } while ((r < 0) && ((r == EINTR) || (r == EAGAIN))); -+ if (rv == -1 && errno == EINTR) -+ continue; -+ if (rv == -1 && errno == EAGAIN) -+ continue; -+ -+ if (!rv) -+ break; - -- if (r < 0) { -- log_warn("io failed %d", r); -+ if (rv < 0) { -+ if (d == DIR_READ) -+ log_debug("Device read error %d offset %llu len %llu", errno, -+ (unsigned long long)(where + pos), -+ (unsigned long long)(len - pos)); -+ else -+ log_debug("Device write error %d offset %llu len %llu", errno, -+ (unsigned long long)(where + pos), -+ (unsigned long long)(len - pos)); - free(io); - return false; -- } -- -- len -= r; -+ } -+ pos += rv; - } - -- if (len) { -- log_warn("short io %u bytes remaining", (unsigned) len); -+ if (pos < len) { -+ if (d == DIR_READ) -+ log_warn("Device read short %u bytes remaining", (unsigned)(len - pos)); -+ else -+ log_warn("Device write short %u bytes remaining", (unsigned)(len - pos)); -+ /* - free(io); - return false; -+ */ - } - - diff --git a/SOURCES/lvm2-2_02_183-build-make-generate.patch b/SOURCES/lvm2-2_02_183-build-make-generate.patch deleted file mode 100644 index c6eb9d1..0000000 --- a/SOURCES/lvm2-2_02_183-build-make-generate.patch +++ /dev/null @@ -1,19 +0,0 @@ - conf/example.conf.in | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/conf/example.conf.in b/conf/example.conf.in -index 742812c..b37e0b2 100644 ---- a/conf/example.conf.in -+++ b/conf/example.conf.in -@@ -903,6 +903,11 @@ global { - # This configuration option has an automatic default value. - # lvdisplay_shows_full_device_path = 0 - -+ # Configuration option global/use_aio. -+ # Use async I/O when reading and writing devices. -+ # This configuration option has an automatic default value. -+ # use_aio = 1 -+ - # Configuration option global/use_lvmetad. - # Use lvmetad to cache metadata and reduce disk scanning. - # When enabled (and running), lvmetad provides LVM commands with VG diff --git a/SOURCES/lvm2-2_02_183-dmsetup-fix-stats-report-command-output.patch b/SOURCES/lvm2-2_02_183-dmsetup-fix-stats-report-command-output.patch deleted file mode 100644 index 82039d4..0000000 --- a/SOURCES/lvm2-2_02_183-dmsetup-fix-stats-report-command-output.patch +++ /dev/null @@ -1,28 +0,0 @@ - tools/dmsetup.c | 10 +++------- - 1 file changed, 3 insertions(+), 7 deletions(-) - -diff --git a/tools/dmsetup.c b/tools/dmsetup.c -index 3cdf862..0b5b808 100644 ---- a/tools/dmsetup.c -+++ b/tools/dmsetup.c -@@ -910,17 +910,13 @@ static int _display_info_cols(struct dm_task *dmt, struct dm_info *info) - if (!(obj.stats = dm_stats_create(DM_STATS_PROGRAM_ID))) - goto_out; - -- if (!dm_stats_get_nr_regions(obj.stats)) { -- log_debug("Skipping %s with no regions.", dm_task_get_name(dmt)); -+ dm_stats_bind_devno(obj.stats, info->major, info->minor); -+ -+ if (!dm_stats_populate(obj.stats, _program_id, DM_STATS_REGIONS_ALL)) { - r = 1; - goto out; - } - -- dm_stats_bind_devno(obj.stats, info->major, info->minor); -- -- if (!dm_stats_populate(obj.stats, _program_id, DM_STATS_REGIONS_ALL)) -- goto_out; -- - /* Update timestamps and handle end-of-interval accounting. */ - _update_interval_times(); - diff --git a/SOURCES/lvm2-2_02_183-io-use-sync-io-if-aio-fails.patch b/SOURCES/lvm2-2_02_183-io-use-sync-io-if-aio-fails.patch deleted file mode 100644 index d44b1ee..0000000 --- a/SOURCES/lvm2-2_02_183-io-use-sync-io-if-aio-fails.patch +++ /dev/null @@ -1,192 +0,0 @@ - lib/commands/toolcontext.c | 2 ++ - lib/config/config_settings.h | 3 +++ - lib/config/defaults.h | 1 + - lib/device/bcache.c | 42 ++++++++++++++++++++++++++++++++++++++++++ - lib/label/label.c | 17 +++++++++++++---- - lib/misc/lvm-globals.c | 11 +++++++++++ - lib/misc/lvm-globals.h | 2 ++ - 7 files changed, 74 insertions(+), 4 deletions(-) - -diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c -index 2b72645..4d3f744 100644 ---- a/lib/commands/toolcontext.c -+++ b/lib/commands/toolcontext.c -@@ -341,6 +341,8 @@ static void _init_logging(struct cmd_context *cmd) - find_config_tree_bool(cmd, global_test_CFG, NULL); - init_test(cmd->default_settings.test); - -+ init_use_aio(find_config_tree_bool(cmd, global_use_aio_CFG, NULL)); -+ - /* Settings for logging to file */ - if (find_config_tree_bool(cmd, log_overwrite_CFG, NULL)) - append = 0; -diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index 6d79087..2de3fd4 100644 ---- a/lib/config/config_settings.h -+++ b/lib/config/config_settings.h -@@ -947,6 +947,9 @@ cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_pa - "Previously this was always shown as /dev/vgname/lvname even when that\n" - "was never a valid path in the /dev filesystem.\n") - -+cfg(global_use_aio_CFG, "use_aio", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_USE_AIO, vsn(2, 2, 183), NULL, 0, NULL, -+ "Use async I/O when reading and writing devices.\n") -+ - cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMETAD, vsn(2, 2, 93), "@DEFAULT_USE_LVMETAD@", 0, NULL, - "Use lvmetad to cache metadata and reduce disk scanning.\n" - "When enabled (and running), lvmetad provides LVM commands with VG\n" -diff --git a/lib/config/defaults.h b/lib/config/defaults.h -index 1a11009..b3e6c34 100644 ---- a/lib/config/defaults.h -+++ b/lib/config/defaults.h -@@ -59,6 +59,7 @@ - #define DEFAULT_METADATA_READ_ONLY 0 - #define DEFAULT_LVDISPLAY_SHOWS_FULL_DEVICE_PATH 0 - #define DEFAULT_UNKNOWN_DEVICE_NAME "[unknown]" -+#define DEFAULT_USE_AIO 1 - - #define DEFAULT_SANLOCK_LV_EXTEND_MB 256 - -diff --git a/lib/device/bcache.c b/lib/device/bcache.c -index 5ac2558..1cb1b2f 100644 ---- a/lib/device/bcache.c -+++ b/lib/device/bcache.c -@@ -380,6 +380,48 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, - return false; - } - -+ /* -+ * If bcache block goes past where lvm wants to write, then clamp it. -+ */ -+ if ((d == DIR_WRITE) && _last_byte_offset && (fd == _last_byte_fd)) { -+ uint64_t offset = where; -+ uint64_t nbytes = len; -+ sector_t limit_nbytes = 0; -+ sector_t extra_nbytes = 0; -+ -+ if (offset > _last_byte_offset) { -+ log_error("Limit write at %llu len %llu beyond last byte %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)_last_byte_offset); -+ return false; -+ } -+ -+ if (offset + nbytes > _last_byte_offset) { -+ limit_nbytes = _last_byte_offset - offset; -+ if (limit_nbytes % _last_byte_sector_size) -+ extra_nbytes = _last_byte_sector_size - (limit_nbytes % _last_byte_sector_size); -+ -+ if (extra_nbytes) { -+ log_debug("Limit write at %llu len %llu to len %llu rounded to %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)limit_nbytes, -+ (unsigned long long)(limit_nbytes + extra_nbytes)); -+ nbytes = limit_nbytes + extra_nbytes; -+ } else { -+ log_debug("Limit write at %llu len %llu to len %llu", -+ (unsigned long long)offset, -+ (unsigned long long)nbytes, -+ (unsigned long long)limit_nbytes); -+ nbytes = limit_nbytes; -+ } -+ } -+ -+ where = offset; -+ len = nbytes; -+ } -+ - while (len) { - do { - if (d == DIR_READ) -diff --git a/lib/label/label.c b/lib/label/label.c -index d2cfe62..e7e3997 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -797,7 +797,7 @@ out: - - static int _setup_bcache(int cache_blocks) - { -- struct io_engine *ioe; -+ struct io_engine *ioe = NULL; - - if (cache_blocks < MIN_BCACHE_BLOCKS) - cache_blocks = MIN_BCACHE_BLOCKS; -@@ -805,9 +805,18 @@ static int _setup_bcache(int cache_blocks) - if (cache_blocks > MAX_BCACHE_BLOCKS) - cache_blocks = MAX_BCACHE_BLOCKS; - -- if (!(ioe = create_async_io_engine())) { -- log_error("Failed to create bcache io engine."); -- return 0; -+ if (use_aio()) { -+ if (!(ioe = create_async_io_engine())) { -+ log_warn("Failed to set up async io, using sync io."); -+ init_use_aio(0); -+ } -+ } -+ -+ if (!ioe) { -+ if (!(ioe = create_sync_io_engine())) { -+ log_error("Failed to set up sync io."); -+ return 0; -+ } - } - - if (!(scan_bcache = bcache_create(BCACHE_BLOCK_SIZE_IN_SECTORS, cache_blocks, ioe))) { -diff --git a/lib/misc/lvm-globals.c b/lib/misc/lvm-globals.c -index 9941489..82c5706 100644 ---- a/lib/misc/lvm-globals.c -+++ b/lib/misc/lvm-globals.c -@@ -24,6 +24,7 @@ - static int _verbose_level = VERBOSE_BASE_LEVEL; - static int _silent = 0; - static int _test = 0; -+static int _use_aio = 0; - static int _md_filtering = 0; - static int _internal_filtering = 0; - static int _fwraid_filtering = 0; -@@ -71,6 +72,11 @@ void init_test(int level) - _test = level; - } - -+void init_use_aio(int use_aio) -+{ -+ _use_aio = use_aio; -+} -+ - void init_md_filtering(int level) - { - _md_filtering = level; -@@ -227,6 +233,11 @@ int test_mode(void) - return _test; - } - -+int use_aio(void) -+{ -+ return _use_aio; -+} -+ - int md_filtering(void) - { - return _md_filtering; -diff --git a/lib/misc/lvm-globals.h b/lib/misc/lvm-globals.h -index b383891..f985cfa 100644 ---- a/lib/misc/lvm-globals.h -+++ b/lib/misc/lvm-globals.h -@@ -25,6 +25,7 @@ enum dev_ext_e; - void init_verbose(int level); - void init_silent(int silent); - void init_test(int level); -+void init_use_aio(int use_aio); - void init_md_filtering(int level); - void init_internal_filtering(int level); - void init_fwraid_filtering(int level); -@@ -58,6 +59,7 @@ const char *get_cmd_name(void); - void set_sysfs_dir_path(const char *path); - - int test_mode(void); -+int use_aio(void); - int md_filtering(void); - int internal_filtering(void); - int fwraid_filtering(void); diff --git a/SOURCES/lvm2-2_02_183-libdm-stats-move-no-regions-warning-after-dm_stats_l.patch b/SOURCES/lvm2-2_02_183-libdm-stats-move-no-regions-warning-after-dm_stats_l.patch deleted file mode 100644 index 0244645..0000000 --- a/SOURCES/lvm2-2_02_183-libdm-stats-move-no-regions-warning-after-dm_stats_l.patch +++ /dev/null @@ -1,31 +0,0 @@ - libdm/libdm-stats.c | 10 +++++----- - 1 file changed, 5 insertions(+), 5 deletions(-) - -diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c -index 94ad380..6b4e3d8 100644 ---- a/libdm/libdm-stats.c -+++ b/libdm/libdm-stats.c -@@ -2336,11 +2336,6 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, - return 0; - } - -- if (!dms->nr_regions) { -- log_error("No regions registered."); -- return 0; -- } -- - /* allow zero-length program_id for populate */ - if (!program_id) - program_id = dms->program_id; -@@ -2352,6 +2347,11 @@ int dm_stats_populate(struct dm_stats *dms, const char *program_id, - goto_bad; - } - -+ if (!dms->nr_regions) { -+ log_verbose("No stats regions registered: %s", dms->name); -+ return 0; -+ } -+ - dms->walk_flags = DM_STATS_WALK_REGION; - dm_stats_walk_start(dms); - do { diff --git a/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-full-md-filter-when-md-1.0-device.patch b/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-full-md-filter-when-md-1.0-device.patch deleted file mode 100644 index 6c2b4f1..0000000 --- a/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-full-md-filter-when-md-1.0-device.patch +++ /dev/null @@ -1,47 +0,0 @@ - tools/pvscan.c | 19 +++++++++++++++++++ - 1 file changed, 19 insertions(+) - -diff --git a/tools/pvscan.c b/tools/pvscan.c -index d9ad097..47ad0f1 100644 ---- a/tools/pvscan.c -+++ b/tools/pvscan.c -@@ -18,6 +18,8 @@ - #include "lvmetad.h" - #include "lvmcache.h" - -+extern int use_full_md_check; -+ - struct pvscan_params { - int new_pvs_found; - int pvs_found; -@@ -302,6 +304,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) - struct dm_list found_vgnames; - struct device *dev; - struct device_list *devl; -+ struct dev_iter *iter; - const char *pv_name; - const char *reason = NULL; - int32_t major = -1; -@@ -443,6 +446,22 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) - /* Creates a list of dev names from /dev, sysfs, etc; does not read any. */ - dev_cache_scan(); - -+ /* See the same check in label_scan() to handle md 0.9/1.0 components. */ -+ if (!(iter = dev_iter_create(cmd->full_filter, 0))) { -+ log_error("Scanning failed to get devices."); -+ return 0; -+ } -+ while ((dev = dev_iter_get(iter))) { -+ if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) { -+ cmd->use_full_md_check = 1; -+ use_full_md_check = 1; -+ log_debug("Found md with end superblock %s", dev_name(dev)); -+ } -+ } -+ dev_iter_destroy(iter); -+ if (!use_full_md_check) -+ log_debug("No md devs with end superblock"); -+ - dm_list_init(&single_devs); - - while (argc--) { diff --git a/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-udev-info-to-improve-md-component.patch b/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-udev-info-to-improve-md-component.patch deleted file mode 100644 index 23ba093..0000000 --- a/SOURCES/lvm2-2_02_183-pvscan-lvmetad-use-udev-info-to-improve-md-component.patch +++ /dev/null @@ -1,183 +0,0 @@ - lib/device/dev-md.c | 14 ++++++++++-- - lib/device/dev-type.c | 62 +++++++++++++++++++++++++++++++++++++++++---------- - lib/device/dev-type.h | 1 + - tools/pvscan.c | 3 ++- - 4 files changed, 65 insertions(+), 15 deletions(-) - -diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c -index 185499b..9728507 100644 ---- a/lib/device/dev-md.c -+++ b/lib/device/dev-md.c -@@ -190,14 +190,24 @@ out: - - int dev_is_md(struct device *dev, uint64_t *offset_found, int full) - { -+ int ret; - - /* - * If non-native device status source is selected, use it - * only if offset_found is not requested as this - * information is not in udev db. - */ -- if ((dev->ext.src == DEV_EXT_NONE) || offset_found) -- return _native_dev_is_md(dev, offset_found, full); -+ if ((dev->ext.src == DEV_EXT_NONE) || offset_found) { -+ ret = _native_dev_is_md(dev, offset_found, full); -+ -+ if (!full) { -+ if (!ret || (ret == -EAGAIN)) { -+ if (udev_dev_is_md_component(dev)) -+ return 1; -+ } -+ } -+ return ret; -+ } - - if (dev->ext.src == DEV_EXT_UDEV) - return _udev_dev_is_md(dev); -diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c -index eda7982..331fe07 100644 ---- a/lib/device/dev-type.c -+++ b/lib/device/dev-type.c -@@ -1003,25 +1003,23 @@ int dev_is_rotational(struct dev_types *dt, struct device *dev) - * failed already due to timeout in udev - in both cases the - * udev_device_get_is_initialized returns 0. - */ --#define UDEV_DEV_IS_MPATH_COMPONENT_ITERATION_COUNT 100 --#define UDEV_DEV_IS_MPATH_COMPONENT_USLEEP 100000 -+#define UDEV_DEV_IS_COMPONENT_ITERATION_COUNT 100 -+#define UDEV_DEV_IS_COMPONENT_USLEEP 100000 - --int udev_dev_is_mpath_component(struct device *dev) -+static struct udev_device *_udev_get_dev(struct device *dev) - { - struct udev *udev_context = udev_get_library_context(); - struct udev_device *udev_device = NULL; -- const char *value; - int initialized = 0; - unsigned i = 0; -- int ret = 0; - - if (!udev_context) { - log_warn("WARNING: No udev context available to check if device %s is multipath component.", dev_name(dev)); -- return 0; -+ return NULL; - } - - while (1) { -- if (i >= UDEV_DEV_IS_MPATH_COMPONENT_ITERATION_COUNT) -+ if (i >= UDEV_DEV_IS_COMPONENT_ITERATION_COUNT) - break; - - if (udev_device) -@@ -1029,7 +1027,7 @@ int udev_dev_is_mpath_component(struct device *dev) - - if (!(udev_device = udev_device_new_from_devnum(udev_context, 'b', dev->dev))) { - log_warn("WARNING: Failed to get udev device handler for device %s.", dev_name(dev)); -- return 0; -+ return NULL; - } - - #ifdef HAVE_LIBUDEV_UDEV_DEVICE_GET_IS_INITIALIZED -@@ -1041,19 +1039,32 @@ int udev_dev_is_mpath_component(struct device *dev) - #endif - - log_debug("Device %s not initialized in udev database (%u/%u, %u microseconds).", dev_name(dev), -- i + 1, UDEV_DEV_IS_MPATH_COMPONENT_ITERATION_COUNT, -- i * UDEV_DEV_IS_MPATH_COMPONENT_USLEEP); -+ i + 1, UDEV_DEV_IS_COMPONENT_ITERATION_COUNT, -+ i * UDEV_DEV_IS_COMPONENT_USLEEP); - -- usleep(UDEV_DEV_IS_MPATH_COMPONENT_USLEEP); -+ usleep(UDEV_DEV_IS_COMPONENT_USLEEP); - i++; - } - - if (!initialized) { - log_warn("WARNING: Device %s not initialized in udev database even after waiting %u microseconds.", -- dev_name(dev), i * UDEV_DEV_IS_MPATH_COMPONENT_USLEEP); -+ dev_name(dev), i * UDEV_DEV_IS_COMPONENT_USLEEP); - goto out; - } - -+out: -+ return udev_device; -+} -+ -+int udev_dev_is_mpath_component(struct device *dev) -+{ -+ struct udev_device *udev_device; -+ const char *value; -+ int ret = 0; -+ -+ if (!(udev_device = _udev_get_dev(dev))) -+ return 0; -+ - value = udev_device_get_property_value(udev_device, DEV_EXT_UDEV_BLKID_TYPE); - if (value && !strcmp(value, DEV_EXT_UDEV_BLKID_TYPE_MPATH)) { - log_debug("Device %s is multipath component based on blkid variable in udev db (%s=\"%s\").", -@@ -1073,6 +1084,28 @@ out: - udev_device_unref(udev_device); - return ret; - } -+ -+int udev_dev_is_md_component(struct device *dev) -+{ -+ struct udev_device *udev_device; -+ const char *value; -+ int ret = 0; -+ -+ if (!(udev_device = _udev_get_dev(dev))) -+ return 0; -+ -+ value = udev_device_get_property_value(udev_device, DEV_EXT_UDEV_BLKID_TYPE); -+ if (value && !strcmp(value, DEV_EXT_UDEV_BLKID_TYPE_SW_RAID)) { -+ log_debug("Device %s is md raid component based on blkid variable in udev db (%s=\"%s\").", -+ dev_name(dev), DEV_EXT_UDEV_BLKID_TYPE, value); -+ ret = 1; -+ goto out; -+ } -+out: -+ udev_device_unref(udev_device); -+ return ret; -+} -+ - #else - - int udev_dev_is_mpath_component(struct device *dev) -@@ -1080,4 +1113,9 @@ int udev_dev_is_mpath_component(struct device *dev) - return 0; - } - -+int udev_dev_is_md_component(struct device *dev) -+{ -+ return 0; -+} -+ - #endif -diff --git a/lib/device/dev-type.h b/lib/device/dev-type.h -index f629a02..2644383 100644 ---- a/lib/device/dev-type.h -+++ b/lib/device/dev-type.h -@@ -62,6 +62,7 @@ int dev_is_swap(struct device *dev, uint64_t *signature, int full); - int dev_is_luks(struct device *dev, uint64_t *signature, int full); - int dasd_is_cdl_formatted(struct device *dev); - int udev_dev_is_mpath_component(struct device *dev); -+int udev_dev_is_md_component(struct device *dev); - - int dev_is_lvm1(struct device *dev, char *buf, int buflen); - int dev_is_pool(struct device *dev, char *buf, int buflen); -diff --git a/tools/pvscan.c b/tools/pvscan.c -index 47ad0f1..cdccfb5 100644 ---- a/tools/pvscan.c -+++ b/tools/pvscan.c -@@ -455,7 +455,8 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) - if (dev_is_md_with_end_superblock(cmd->dev_types, dev)) { - cmd->use_full_md_check = 1; - use_full_md_check = 1; -- log_debug("Found md with end superblock %s", dev_name(dev)); -+ log_debug("Found md component in sysfs with end superblock %s", dev_name(dev)); -+ break; - } - } - dev_iter_destroy(iter); diff --git a/SOURCES/lvm2-2_02_183-scan-md-metadata-version-0.90-is-at-the-end-of-disk.patch b/SOURCES/lvm2-2_02_183-scan-md-metadata-version-0.90-is-at-the-end-of-disk.patch deleted file mode 100644 index ce15ee0..0000000 --- a/SOURCES/lvm2-2_02_183-scan-md-metadata-version-0.90-is-at-the-end-of-disk.patch +++ /dev/null @@ -1,44 +0,0 @@ - lib/device/dev-md.c | 2 +- - lib/filters/filter-md.c | 6 +++--- - 2 files changed, 4 insertions(+), 4 deletions(-) - -diff --git a/lib/device/dev-md.c b/lib/device/dev-md.c -index 7196dc0..185499b 100644 ---- a/lib/device/dev-md.c -+++ b/lib/device/dev-md.c -@@ -422,7 +422,7 @@ int dev_is_md_with_end_superblock(struct dev_types *dt, struct device *dev) - log_very_verbose("Device %s %s is %s.", - dev_name(dev), attribute, version_string); - -- if (!strcmp(version_string, "1.0")) -+ if (!strcmp(version_string, "1.0") || !strcmp(version_string, "0.90")) - return 1; - return 0; - } -diff --git a/lib/filters/filter-md.c b/lib/filters/filter-md.c -index e03ff50..2011e1d 100644 ---- a/lib/filters/filter-md.c -+++ b/lib/filters/filter-md.c -@@ -47,7 +47,7 @@ extern int use_full_md_check; - * 3. use udev to detect components - * - * mode 1 will not detect and exclude components of md devices -- * that use superblock version 1.0 which is at the end of the device. -+ * that use superblock version 0.9 or 1.0 which is at the end of the device. - * - * mode 2 will detect these, but mode 2 doubles the i/o done by label - * scan, since there's a read at both the start and end of every device. -@@ -60,11 +60,11 @@ extern int use_full_md_check; - * - * - the command is pvcreate/vgcreate/vgextend, which format new - * devices, and if the user ran these commands on a component -- * device of an md device 1.0, then it would cause problems. -+ * device of an md device 0.9 or 1.0, then it would cause problems. - * FIXME: this would only really need to scan the end of the - * devices being formatted, not all devices. - * -- * - it sees an md device on the system using version 1.0. -+ * - it sees an md device on the system using version 0.9 or 1.0. - * The point of this is just to avoid displaying md components - * from the 'pvs' command. - * FIXME: the cost (double i/o) may not be worth the benefit diff --git a/SOURCES/lvm2-2_02_184-apply-obtain_device_list_from_udev-to-all-libudev-us.patch b/SOURCES/lvm2-2_02_184-apply-obtain_device_list_from_udev-to-all-libudev-us.patch deleted file mode 100644 index 57befdb..0000000 --- a/SOURCES/lvm2-2_02_184-apply-obtain_device_list_from_udev-to-all-libudev-us.patch +++ /dev/null @@ -1,27 +0,0 @@ - lib/device/dev-type.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c -index 331fe07..60b0d78 100644 ---- a/lib/device/dev-type.c -+++ b/lib/device/dev-type.c -@@ -1062,6 +1062,9 @@ int udev_dev_is_mpath_component(struct device *dev) - const char *value; - int ret = 0; - -+ if (!obtain_device_list_from_udev()) -+ return 0; -+ - if (!(udev_device = _udev_get_dev(dev))) - return 0; - -@@ -1091,6 +1094,9 @@ int udev_dev_is_md_component(struct device *dev) - const char *value; - int ret = 0; - -+ if (!obtain_device_list_from_udev()) -+ return 0; -+ - if (!(udev_device = _udev_get_dev(dev))) - return 0; - diff --git a/SOURCES/lvm2-2_02_184-config-add-new-setting-io_memory_size.patch b/SOURCES/lvm2-2_02_184-config-add-new-setting-io_memory_size.patch deleted file mode 100644 index 3d876ab..0000000 --- a/SOURCES/lvm2-2_02_184-config-add-new-setting-io_memory_size.patch +++ /dev/null @@ -1,160 +0,0 @@ - lib/commands/toolcontext.c | 2 ++ - lib/config/config_settings.h | 8 ++++++++ - lib/config/defaults.h | 2 ++ - lib/label/label.c | 40 ++++++++++++++++++++-------------------- - lib/misc/lvm-globals.c | 10 ++++++++++ - lib/misc/lvm-globals.h | 3 +++ - 6 files changed, 45 insertions(+), 20 deletions(-) - -diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c -index 4d3f744..95b2317 100644 ---- a/lib/commands/toolcontext.c -+++ b/lib/commands/toolcontext.c -@@ -693,6 +693,8 @@ static int _process_config(struct cmd_context *cmd) - if (!_init_system_id(cmd)) - return_0; - -+ init_io_memory_size(find_config_tree_int(cmd, global_io_memory_size_CFG, NULL)); -+ - return 1; - } - -diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index 2de3fd4..c3e9600 100644 ---- a/lib/config/config_settings.h -+++ b/lib/config/config_settings.h -@@ -1138,6 +1138,14 @@ cfg(global_notify_dbus_CFG, "notify_dbus", global_CFG_SECTION, 0, CFG_TYPE_BOOL, - "When enabled, an LVM command that changes PVs, changes VG metadata,\n" - "or changes the activation state of an LV will send a notification.\n") - -+cfg(global_io_memory_size_CFG, "io_memory_size", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_IO_MEMORY_SIZE_KB, vsn(2, 2, 184), NULL, 0, NULL, -+ "The amount of memory in KiB that LVM allocates to perform disk io.\n" -+ "LVM performance may benefit from more io memory when there are many\n" -+ "disks or VG metadata is large. Increasing this size may be necessary\n" -+ "when a single copy of VG metadata is larger than the current setting.\n" -+ "This value should usually not be decreased from the default; setting\n" -+ "it too low can result in lvm failing to read VGs.\n") -+ - cfg(activation_udev_sync_CFG, "udev_sync", activation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_UDEV_SYNC, vsn(2, 2, 51), NULL, 0, NULL, - "Use udev notifications to synchronize udev and LVM.\n" - "The --nodevsync option overrides this setting.\n" -diff --git a/lib/config/defaults.h b/lib/config/defaults.h -index b3e6c34..690bf56 100644 ---- a/lib/config/defaults.h -+++ b/lib/config/defaults.h -@@ -267,4 +267,6 @@ - #define DEFAULT_THIN_POOL_AUTOEXTEND_THRESHOLD 100 - #define DEFAULT_THIN_POOL_AUTOEXTEND_PERCENT 20 - -+#define DEFAULT_IO_MEMORY_SIZE_KB 4096 -+ - #endif /* _LVM_DEFAULTS_H */ -diff --git a/lib/label/label.c b/lib/label/label.c -index 03726d0..4ec7d9b 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -772,33 +772,33 @@ out: - } - - /* -- * How many blocks to set up in bcache? Is 1024 a good max? -+ * num_devs is the number of devices the caller is going to scan. -+ * When 0 the caller doesn't know, and we use the default cache size. -+ * When non-zero, allocate at least num_devs bcache blocks. -+ * num_devs doesn't really tell us how many bcache blocks we'll use -+ * because it includes lvm devs and non-lvm devs, and each lvm dev -+ * will often use a number of bcache blocks. - * -- * Currently, we tell bcache to set up N blocks where N -- * is the number of devices that are going to be scanned. -- * Reasons why this number may not be be a good choice: -- * -- * - there may be a lot of non-lvm devices, which -- * would make this number larger than necessary -- * -- * - each lvm device may use more than one cache -- * block if the metadata is large enough or it -- * uses more than one metadata area, which -- * would make this number smaller than it -- * should be for the best performance. -- * -- * This is even more tricky to estimate when lvmetad -- * is used, because it's hard to predict how many -- * devs might need to be scanned when using lvmetad. -- * This currently just sets up bcache with MIN blocks. -+ * We don't know ahead of time if we will find some VG metadata -+ * that is larger than the total size of the bcache, which would -+ * prevent us from reading/writing the VG since we do not dynamically -+ * increase the bcache size when we find it's too small. In these -+ * cases the user would need to set io_memory_size to be larger -+ * than the max VG metadata size (lvm does not impose any limit on -+ * the metadata size.) - */ - --#define MIN_BCACHE_BLOCKS 32 -+#define MIN_BCACHE_BLOCKS 32 /* 4MB, currently matches DEFAULT_IO_MEMORY_SIZE_KB */ - #define MAX_BCACHE_BLOCKS 1024 - --static int _setup_bcache(int cache_blocks) -+static int _setup_bcache(int num_devs) - { - struct io_engine *ioe = NULL; -+ int iomem_kb = io_memory_size(); -+ int block_size_kb = (BCACHE_BLOCK_SIZE_IN_SECTORS * 512) / 1024; -+ int cache_blocks; -+ -+ cache_blocks = iomem_kb / block_size_kb; - - if (cache_blocks < MIN_BCACHE_BLOCKS) - cache_blocks = MIN_BCACHE_BLOCKS; -diff --git a/lib/misc/lvm-globals.c b/lib/misc/lvm-globals.c -index 82c5706..3bd5cac 100644 ---- a/lib/misc/lvm-globals.c -+++ b/lib/misc/lvm-globals.c -@@ -54,6 +54,7 @@ static char _sysfs_dir_path[PATH_MAX] = ""; - static int _dev_disable_after_error_count = DEFAULT_DISABLE_AFTER_ERROR_COUNT; - static uint64_t _pv_min_size = (DEFAULT_PV_MIN_SIZE_KB * 1024L >> SECTOR_SHIFT); - static const char *_unknown_device_name = DEFAULT_UNKNOWN_DEVICE_NAME; -+static int _io_memory_size_kb = DEFAULT_IO_MEMORY_SIZE_KB; - - void init_verbose(int level) - { -@@ -387,3 +388,12 @@ void init_unknown_device_name(const char *name) - _unknown_device_name = name; - } - -+int io_memory_size(void) -+{ -+ return _io_memory_size_kb; -+} -+ -+void init_io_memory_size(int val) -+{ -+ _io_memory_size_kb = val; -+} -diff --git a/lib/misc/lvm-globals.h b/lib/misc/lvm-globals.h -index f985cfa..3007cc5 100644 ---- a/lib/misc/lvm-globals.h -+++ b/lib/misc/lvm-globals.h -@@ -53,6 +53,7 @@ void init_pv_min_size(uint64_t sectors); - void init_activation_checks(int checks); - void init_retry_deactivation(int retry); - void init_unknown_device_name(const char *name); -+void init_io_memory_size(int val); - - void set_cmd_name(const char *cmd_name); - const char *get_cmd_name(void); -@@ -86,6 +87,7 @@ uint64_t pv_min_size(void); - int activation_checks(void); - int retry_deactivation(void); - const char *unknown_device_name(void); -+int io_memory_size(void); - - #define DMEVENTD_MONITOR_IGNORE -1 - int dmeventd_monitor_mode(void); -@@ -93,4 +95,5 @@ int dmeventd_monitor_mode(void); - #define NO_DEV_ERROR_COUNT_LIMIT 0 - int dev_disable_after_error_count(void); - -+ - #endif diff --git a/SOURCES/lvm2-2_02_184-dm-migration_threshold-for-old-linked-tools.patch b/SOURCES/lvm2-2_02_184-dm-migration_threshold-for-old-linked-tools.patch deleted file mode 100644 index ee0ccdc..0000000 --- a/SOURCES/lvm2-2_02_184-dm-migration_threshold-for-old-linked-tools.patch +++ /dev/null @@ -1,73 +0,0 @@ - WHATS_NEW_DM | 4 ++++ - libdm/libdm-deptree.c | 20 +++++++++++++++++--- - 2 files changed, 21 insertions(+), 3 deletions(-) - -diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM -index bbd1057..68b7c0d 100644 ---- a/WHATS_NEW_DM -+++ b/WHATS_NEW_DM -@@ -1,3 +1,7 @@ -+Version 1.02.156 - -+===================================== -+ Ensure migration_threshold for cache is at least 8 chunks. -+ - Version 1.02.154 - - ============================== - Fix dmstats report printing no output. -diff --git a/libdm/libdm-deptree.c b/libdm/libdm-deptree.c -index ab05456..0728611 100644 ---- a/libdm/libdm-deptree.c -+++ b/libdm/libdm-deptree.c -@@ -192,6 +192,7 @@ struct load_segment { - uint64_t transaction_id; /* Thin_pool */ - uint64_t low_water_mark; /* Thin_pool */ - uint32_t data_block_size; /* Thin_pool + cache */ -+ uint32_t migration_threshold; /* Cache */ - unsigned skip_block_zeroing; /* Thin_pool */ - unsigned ignore_discard; /* Thin_pool target vsn 1.1 */ - unsigned no_discard_passdown; /* Thin_pool target vsn 1.1 */ -@@ -2462,10 +2463,14 @@ static int _cache_emit_segment_line(struct dm_task *dmt, - - EMIT_PARAMS(pos, " %s", name); - -- EMIT_PARAMS(pos, " %u", seg->policy_argc * 2); -+ /* Do not pass migration_threshold 2048 which is default */ -+ EMIT_PARAMS(pos, " %u", (seg->policy_argc + (seg->migration_threshold != 2048) ? 1 : 0) * 2); -+ if (seg->migration_threshold != 2048) -+ EMIT_PARAMS(pos, " migration_threshold %u", seg->migration_threshold); - if (seg->policy_settings) - for (cn = seg->policy_settings->child; cn; cn = cn->sib) -- EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i); -+ if (cn->v) /* Skip deleted entry */ -+ EMIT_PARAMS(pos, " %s %" PRIu64, cn->key, cn->v->v.i); - - return 1; - } -@@ -3373,6 +3378,7 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node, - seg->data_block_size = data_block_size; - seg->flags = feature_flags; - seg->policy_name = policy_name; -+ seg->migration_threshold = 2048; /* Default migration threshold 1MiB */ - - /* FIXME: better validation missing */ - if (policy_settings) { -@@ -3385,10 +3391,18 @@ int dm_tree_node_add_cache_target(struct dm_tree_node *node, - log_error("Cache policy parameter %s is without integer value.", cn->key); - return 0; - } -- seg->policy_argc++; -+ if (strcmp(cn->key, "migration_threshold") == 0) { -+ seg->migration_threshold = cn->v->v.i; -+ cn->v = NULL; /* skip this entry */ -+ } else -+ seg->policy_argc++; - } - } - -+ /* Always some throughput available for cache to proceed */ -+ if (seg->migration_threshold < data_block_size * 8) -+ seg->migration_threshold = data_block_size * 8; -+ - return 1; - } - diff --git a/SOURCES/lvm2-2_02_184-io-increase-the-default-io-memory-from-4-to-8-MiB.patch b/SOURCES/lvm2-2_02_184-io-increase-the-default-io-memory-from-4-to-8-MiB.patch deleted file mode 100644 index db6a9ba..0000000 --- a/SOURCES/lvm2-2_02_184-io-increase-the-default-io-memory-from-4-to-8-MiB.patch +++ /dev/null @@ -1,29 +0,0 @@ - lib/config/defaults.h | 2 +- - lib/label/label.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/config/defaults.h b/lib/config/defaults.h -index 690bf56..ad20e0f 100644 ---- a/lib/config/defaults.h -+++ b/lib/config/defaults.h -@@ -267,6 +267,6 @@ - #define DEFAULT_THIN_POOL_AUTOEXTEND_THRESHOLD 100 - #define DEFAULT_THIN_POOL_AUTOEXTEND_PERCENT 20 - --#define DEFAULT_IO_MEMORY_SIZE_KB 4096 -+#define DEFAULT_IO_MEMORY_SIZE_KB 8192 - - #endif /* _LVM_DEFAULTS_H */ -diff --git a/lib/label/label.c b/lib/label/label.c -index 4fdbbb7..00dadfd 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -791,7 +791,7 @@ out: - * the metadata size.) - */ - --#define MIN_BCACHE_BLOCKS 32 /* 4MB, currently matches DEFAULT_IO_MEMORY_SIZE_KB */ -+#define MIN_BCACHE_BLOCKS 32 /* 4MB */ - #define MAX_BCACHE_BLOCKS 1024 - - static int _setup_bcache(int num_devs) diff --git a/SOURCES/lvm2-2_02_184-io-warn-when-metadata-size-approaches-io-memory-size.patch b/SOURCES/lvm2-2_02_184-io-warn-when-metadata-size-approaches-io-memory-size.patch deleted file mode 100644 index 6df9bd9..0000000 --- a/SOURCES/lvm2-2_02_184-io-warn-when-metadata-size-approaches-io-memory-size.patch +++ /dev/null @@ -1,136 +0,0 @@ - lib/cache/lvmcache.c | 15 +++++++++++++++ - lib/cache/lvmcache.h | 3 +++ - lib/format_text/format-text.c | 4 ++++ - lib/label/label.c | 41 +++++++++++++++++++++++++++++++++++++++++ - 4 files changed, 63 insertions(+) - -diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c -index f55a14c..62f1d3c 100644 ---- a/lib/cache/lvmcache.c -+++ b/lib/cache/lvmcache.c -@@ -3048,3 +3048,18 @@ int lvmcache_scan_mismatch(struct cmd_context *cmd, const char *vgname, const ch - return 1; - } - -+static uint64_t _max_metadata_size; -+ -+void lvmcache_save_metadata_size(uint64_t val) -+{ -+ if (!_max_metadata_size) -+ _max_metadata_size = val; -+ else if (_max_metadata_size < val) -+ _max_metadata_size = val; -+} -+ -+uint64_t lvmcache_max_metadata_size(void) -+{ -+ return _max_metadata_size; -+} -+ -diff --git a/lib/cache/lvmcache.h b/lib/cache/lvmcache.h -index bf976e9..f436785 100644 ---- a/lib/cache/lvmcache.h -+++ b/lib/cache/lvmcache.h -@@ -225,4 +225,7 @@ struct volume_group *lvmcache_get_saved_vg(const char *vgid, int precommitted); - struct volume_group *lvmcache_get_saved_vg_latest(const char *vgid); - void lvmcache_drop_saved_vgid(const char *vgid); - -+uint64_t lvmcache_max_metadata_size(void); -+void lvmcache_save_metadata_size(uint64_t val); -+ - #endif -diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c -index 36afba1..200b011 100644 ---- a/lib/format_text/format-text.c -+++ b/lib/format_text/format-text.c -@@ -1294,6 +1294,10 @@ int read_metadata_location_summary(const struct format_type *fmt, - */ - vgsummary->mda_checksum = rlocn->checksum; - vgsummary->mda_size = rlocn->size; -+ -+ /* Keep track of largest metadata size we find. */ -+ lvmcache_save_metadata_size(rlocn->size); -+ - lvmcache_lookup_mda(vgsummary); - - if (!text_read_metadata_summary(fmt, dev_area->dev, MDA_CONTENT_REASON(primary_mda), -diff --git a/lib/label/label.c b/lib/label/label.c -index 4ec7d9b..4fdbbb7 100644 ---- a/lib/label/label.c -+++ b/lib/label/label.c -@@ -21,6 +21,7 @@ - #include "bcache.h" - #include "toolcontext.h" - #include "activate.h" -+#include "metadata.h" - - #include - #include -@@ -29,6 +30,8 @@ - - int use_full_md_check; - -+static uint64_t _current_bcache_size_bytes; -+ - /* FIXME Allow for larger labels? Restricted to single sector currently */ - - /* -@@ -806,6 +809,8 @@ static int _setup_bcache(int num_devs) - if (cache_blocks > MAX_BCACHE_BLOCKS) - cache_blocks = MAX_BCACHE_BLOCKS; - -+ _current_bcache_size_bytes = cache_blocks * BCACHE_BLOCK_SIZE_IN_SECTORS * 512; -+ - if (use_aio()) { - if (!(ioe = create_async_io_engine())) { - log_warn("Failed to set up async io, using sync io."); -@@ -839,6 +844,7 @@ int label_scan(struct cmd_context *cmd) - struct dev_iter *iter; - struct device_list *devl, *devl2; - struct device *dev; -+ uint64_t max_metadata_size_bytes; - - log_debug_devs("Finding devices to scan"); - -@@ -909,6 +915,41 @@ int label_scan(struct cmd_context *cmd) - - _scan_list(cmd, cmd->full_filter, &all_devs, NULL); - -+ /* -+ * Metadata could be larger than total size of bcache, and bcache -+ * cannot currently be resized during the command. If this is the -+ * case (or within reach), warn that io_memory_size needs to be -+ * set larger. -+ * -+ * Even if bcache out of space did not cause a failure during scan, it -+ * may cause a failure during the next vg_read phase or during vg_write. -+ * -+ * If there was an error during scan, we could recreate bcache here -+ * with a larger size and then restart label_scan. But, this does not -+ * address the problem of writing new metadata that excedes the bcache -+ * size and failing, which would often be hit first, i.e. we'll fail -+ * to write new metadata exceding the max size before we have a chance -+ * to read any metadata with that size, unless we find an existing vg -+ * that has been previously created with the larger size. -+ * -+ * If the largest metadata is within 1MB of the bcache size, then start -+ * warning. -+ */ -+ max_metadata_size_bytes = lvmcache_max_metadata_size(); -+ -+ if (max_metadata_size_bytes + (1024 * 1024) > _current_bcache_size_bytes) { -+ /* we want bcache to be 1MB larger than the max metadata seen */ -+ uint64_t want_size_kb = (max_metadata_size_bytes / 1024) + 1024; -+ uint64_t remainder; -+ if ((remainder = (want_size_kb % 1024))) -+ want_size_kb = want_size_kb + 1024 - remainder; -+ -+ log_warn("WARNING: metadata may not be usable with current io_memory_size %d KiB", -+ io_memory_size()); -+ log_warn("WARNING: increase lvm.conf io_memory_size to at least %llu KiB", -+ (unsigned long long)want_size_kb); -+ } -+ - dm_list_iterate_items_safe(devl, devl2, &all_devs) { - dm_list_del(&devl->list); - dm_free(devl); diff --git a/SOURCES/lvm2-2_02_184-pvscan-lvmetad-init-should-set-updating-before-scann.patch b/SOURCES/lvm2-2_02_184-pvscan-lvmetad-init-should-set-updating-before-scann.patch deleted file mode 100644 index 0dfbfd8..0000000 --- a/SOURCES/lvm2-2_02_184-pvscan-lvmetad-init-should-set-updating-before-scann.patch +++ /dev/null @@ -1,138 +0,0 @@ - lib/cache/lvmetad.c | 44 ++++++++++++++++++++++++-------------------- - tools/pvscan.c | 9 ++++----- - 2 files changed, 28 insertions(+), 25 deletions(-) - -diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c -index 2a2d7ea..da8c027 100644 ---- a/lib/cache/lvmetad.c -+++ b/lib/cache/lvmetad.c -@@ -312,6 +312,7 @@ retry: - * The caller should do a disk scan to populate lvmetad. - */ - if (!strcmp(daemon_token, "none")) { -+ log_debug_lvmetad("lvmetad initialization needed."); - ret = 0; - goto out; - } -@@ -323,10 +324,16 @@ retry: - * our global filter. - */ - if (strcmp(daemon_token, _lvmetad_token)) { -+ log_debug_lvmetad("lvmetad initialization needed for different filter."); - ret = 0; - goto out; - } - -+ if (wait_start) -+ log_debug_lvmetad("lvmetad initialized during wait."); -+ else -+ log_debug_lvmetad("lvmetad initialized previously."); -+ - out: - daemon_reply_destroy(reply); - return ret; -@@ -2362,28 +2369,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) - replacing_other_update = 1; - } - -- label_scan(cmd); -- -- lvmcache_pvscan_duplicate_check(cmd); -- -- if (lvmcache_found_duplicate_pvs()) { -- log_warn("WARNING: Scan found duplicate PVs."); -- return 0; -- } -- -- log_verbose("Scanning all devices to update lvmetad."); -- -- if (!(iter = dev_iter_create(cmd->lvmetad_filter, 1))) { -- log_error("dev_iter creation failed"); -- return 0; -- } -- - future_token = _lvmetad_token; - _lvmetad_token = (char *) LVMETAD_TOKEN_UPDATE_IN_PROGRESS; - - if (!_token_update(&replaced_update)) { -- log_error("Failed to update lvmetad which had an update in progress."); -- dev_iter_destroy(iter); -+ log_error("Failed to start lvmetad update."); - _lvmetad_token = future_token; - return 0; - } -@@ -2399,16 +2389,18 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) - if (do_wait && !retries) { - retries = 1; - log_warn("WARNING: lvmetad update in progress, retrying update."); -- dev_iter_destroy(iter); - _lvmetad_token = future_token; - goto retry; - } - log_warn("WARNING: lvmetad update in progress, skipping update."); -- dev_iter_destroy(iter); - _lvmetad_token = future_token; - return 0; - } - -+ log_verbose("Scanning all devices to initialize lvmetad."); -+ -+ label_scan(cmd); -+ - log_debug_lvmetad("Telling lvmetad to clear its cache"); - reply = _lvmetad_send(cmd, "pv_clear_all", NULL); - if (!_lvmetad_handle_reply(reply, "pv_clear_all", "", NULL)) -@@ -2418,6 +2410,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) - was_silent = silent_mode(); - init_silent(1); - -+ if (!(iter = dev_iter_create(cmd->lvmetad_filter, 1))) { -+ log_error("dev_iter creation failed"); -+ return 0; -+ } -+ - while ((dev = dev_iter_get(iter))) { - if (sigint_caught()) { - ret = 0; -@@ -2453,6 +2450,13 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) - return 0; - } - -+ /* This will disable lvmetad if label scan found duplicates. */ -+ lvmcache_pvscan_duplicate_check(cmd); -+ if (lvmcache_found_duplicate_pvs()) { -+ log_warn("WARNING: Scan found duplicate PVs."); -+ return 0; -+ } -+ - /* - * If lvmetad is disabled, and no lvm1 metadata was seen and no - * duplicate PVs were seen, then re-enable lvmetad. -diff --git a/tools/pvscan.c b/tools/pvscan.c -index cdccfb5..a5e01b3 100644 ---- a/tools/pvscan.c -+++ b/tools/pvscan.c -@@ -381,7 +381,7 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) - all_vgs = 1; - goto activate; - } -- -+ - /* - * FIXME: when specific devs are named, we generally don't want to scan - * any other devs, but if lvmetad is not yet populated, the first -@@ -390,11 +390,10 @@ static int _pvscan_cache(struct cmd_context *cmd, int argc, char **argv) - * never scan any devices other than those specified. - */ - if (!lvmetad_token_matches(cmd)) { -- log_verbose("Scanning all devices to initialize lvmetad."); -- - if (lvmetad_used() && !lvmetad_pvscan_all_devs(cmd, 0)) { -- log_warn("WARNING: Not using lvmetad because cache update failed."); -- lvmetad_make_unused(cmd); -+ log_warn("WARNING: Not updating lvmetad because cache update failed."); -+ ret = ECMD_FAILED; -+ goto out; - } - if (lvmetad_used() && lvmetad_is_disabled(cmd, &reason)) { - log_warn("WARNING: Not using lvmetad because %s.", reason); diff --git a/SOURCES/lvm2-2_02_185-bcache-Fix-memory-leak.patch b/SOURCES/lvm2-2_02_185-bcache-Fix-memory-leak.patch deleted file mode 100644 index acdfabe..0000000 --- a/SOURCES/lvm2-2_02_185-bcache-Fix-memory-leak.patch +++ /dev/null @@ -1,15 +0,0 @@ - lib/device/bcache.c | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/lib/device/bcache.c b/lib/device/bcache.c -index 7384a32..f64931f 100644 ---- a/lib/device/bcache.c -+++ b/lib/device/bcache.c -@@ -411,6 +411,7 @@ static bool _sync_issue(struct io_engine *ioe, enum dir d, int fd, - (unsigned long long)offset, - (unsigned long long)nbytes, - (unsigned long long)_last_byte_offset); -+ free(io); - return false; - } - diff --git a/SOURCES/lvm2-2_02_186-cache-support-no_discard_passdown.patch b/SOURCES/lvm2-2_02_186-cache-support-no_discard_passdown.patch new file mode 100644 index 0000000..db8fa0d --- /dev/null +++ b/SOURCES/lvm2-2_02_186-cache-support-no_discard_passdown.patch @@ -0,0 +1,71 @@ + WHATS_NEW | 1 + + WHATS_NEW_DM | 4 ++++ + lib/metadata/lv.c | 5 +++++ + libdm/libdevmapper.h | 1 + + libdm/libdm-targets.c | 2 ++ + 5 files changed, 13 insertions(+) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 106661f..d3da403 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,5 +1,6 @@ + Version 2.02.186 - + ================================ ++ Report no_discard_passdown for cache LVs with lvs -o+kernel_discards. + Prevent shared active mirror LVs with lvmlockd. + + Version 2.02.185 - 13th May 2019 +diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM +index 7c74bfe..8c78724 100644 +--- a/WHATS_NEW_DM ++++ b/WHATS_NEW_DM +@@ -1,3 +1,7 @@ ++Version 1.02.160 - ++================================ ++ Parsing of cache status understand no_discard_passdown. ++ + Version 1.02.158 - 13th May 2019 + ================================ + +diff --git a/lib/metadata/lv.c b/lib/metadata/lv.c +index 2abe42d..538b292 100644 +--- a/lib/metadata/lv.c ++++ b/lib/metadata/lv.c +@@ -245,6 +245,11 @@ char *lvseg_kernel_discards_dup_with_info_and_seg_status(struct dm_pool *mem, co + return 0; + } + s = get_pool_discards_name(d); ++ } else if (lvdm->seg_status.type == SEG_STATUS_CACHE) { ++ if (lvdm->seg_status.cache->feature_flags & ++ DM_CACHE_FEATURE_NO_DISCARD_PASSDOWN) { ++ s = "nopassdown"; ++ } + } + + if (!(ret = dm_pool_strdup(mem, s))) { +diff --git a/libdm/libdevmapper.h b/libdm/libdevmapper.h +index 19032d7..e885f52 100644 +--- a/libdm/libdevmapper.h ++++ b/libdm/libdevmapper.h +@@ -1893,6 +1893,7 @@ int dm_tree_node_add_raid_target_with_params_v2(struct dm_tree_node *node, + #define DM_CACHE_FEATURE_WRITETHROUGH 0x00000002 + #define DM_CACHE_FEATURE_PASSTHROUGH 0x00000004 + #define DM_CACHE_FEATURE_METADATA2 0x00000008 /* cache v1.10 */ ++#define DM_CACHE_FEATURE_NO_DISCARD_PASSDOWN 0x00000010 + + struct dm_config_node; + /* +diff --git a/libdm/libdm-targets.c b/libdm/libdm-targets.c +index 8766789..d0a8b43 100644 +--- a/libdm/libdm-targets.c ++++ b/libdm/libdm-targets.c +@@ -296,6 +296,8 @@ int dm_get_status_cache(struct dm_pool *mem, const char *params, + s->feature_flags |= DM_CACHE_FEATURE_PASSTHROUGH; + else if (!strncmp(p, "metadata2 ", 10)) + s->feature_flags |= DM_CACHE_FEATURE_METADATA2; ++ else if (!strncmp(p, "no_discard_passdown ", 20)) ++ s->feature_flags |= DM_CACHE_FEATURE_NO_DISCARD_PASSDOWN; + else + log_error("Unknown feature in status: %s", params); + diff --git a/SOURCES/lvm2-2_02_186-lvmlockd-do-not-allow-mirror-LV-to-be-activated-shar.patch b/SOURCES/lvm2-2_02_186-lvmlockd-do-not-allow-mirror-LV-to-be-activated-shar.patch new file mode 100644 index 0000000..8ae9a97 --- /dev/null +++ b/SOURCES/lvm2-2_02_186-lvmlockd-do-not-allow-mirror-LV-to-be-activated-shar.patch @@ -0,0 +1,156 @@ + WHATS_NEW | 4 ++++ + lib/commands/toolcontext.h | 1 - + lib/locking/lvmlockd.c | 38 +------------------------------------- + lib/metadata/mirror.c | 12 ------------ + lib/mirror/mirrored.c | 9 --------- + man/lvmlockd.8_main | 2 +- + 6 files changed, 6 insertions(+), 60 deletions(-) + +diff --git a/WHATS_NEW b/WHATS_NEW +index 4e75c6a..106661f 100644 +--- a/WHATS_NEW ++++ b/WHATS_NEW +@@ -1,3 +1,7 @@ ++Version 2.02.186 - ++================================ ++ Prevent shared active mirror LVs with lvmlockd. ++ + Version 2.02.185 - 13th May 2019 + ================================ + Fix change of monitoring in clustered volumes. +diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h +index da5d582..485dca9 100644 +--- a/lib/commands/toolcontext.h ++++ b/lib/commands/toolcontext.h +@@ -163,7 +163,6 @@ struct cmd_context { + unsigned lockd_vg_rescan:1; + unsigned lockd_vg_default_sh:1; + unsigned lockd_vg_enforce_sh:1; +- unsigned lockd_lv_sh:1; + unsigned vg_notify:1; + unsigned lv_notify:1; + unsigned pv_notify:1; +diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c +index 788b62b..1160126 100644 +--- a/lib/locking/lvmlockd.c ++++ b/lib/locking/lvmlockd.c +@@ -2076,15 +2076,6 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg, + return 0; + } + +- /* +- * This is a hack for mirror LVs which need to know at a very low level +- * which lock mode the LV is being activated with so that it can pick +- * a mirror log type during activation. Do not use this for anything +- * else. +- */ +- if (mode && !strcmp(mode, "sh")) +- cmd->lockd_lv_sh = 1; +- + if (!mode) + mode = "ex"; + +@@ -2209,31 +2200,6 @@ static int _lockd_lv_thin(struct cmd_context *cmd, struct logical_volume *lv, + } + + /* +- * Only the combination of dlm + corosync + cmirrord allows +- * mirror LVs to be activated in shared mode on multiple nodes. +- */ +-static int _lockd_lv_mirror(struct cmd_context *cmd, struct logical_volume *lv, +- const char *def_mode, uint32_t flags) +-{ +- if (!strcmp(lv->vg->lock_type, "sanlock")) +- flags |= LDLV_MODE_NO_SH; +- +- else if (!strcmp(lv->vg->lock_type, "dlm") && def_mode && !strcmp(def_mode, "sh")) { +-#ifdef CMIRRORD_PIDFILE +- if (!cmirrord_is_running()) { +- log_error("cmirrord must be running to activate an LV in shared mode."); +- return 0; +- } +-#else +- flags |= LDLV_MODE_NO_SH; +-#endif +- } +- +- return lockd_lv_name(cmd, lv->vg, lv->name, &lv->lvid.id[1], +- lv->lock_args, def_mode, flags); +-} +- +-/* + * If the VG has no lock_type, then this function can return immediately. + * The LV itself may have no lock (NULL lv->lock_args), but the lock request + * may be directed to another lock, e.g. the pool LV lock in _lockd_lv_thin. +@@ -2286,14 +2252,12 @@ int lockd_lv(struct cmd_context *cmd, struct logical_volume *lv, + */ + if (lv_is_external_origin(lv) || + lv_is_thin_type(lv) || ++ lv_is_mirror_type(lv) || + lv_is_raid_type(lv) || + lv_is_cache_type(lv)) { + flags |= LDLV_MODE_NO_SH; + } + +- if (lv_is_mirror_type(lv)) +- return _lockd_lv_mirror(cmd, lv, def_mode, flags); +- + return lockd_lv_name(cmd, lv->vg, lv->name, &lv->lvid.id[1], + lv->lock_args, def_mode, flags); + } +diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c +index b1dcaa0..cd8ce1e 100644 +--- a/lib/metadata/mirror.c ++++ b/lib/metadata/mirror.c +@@ -2104,18 +2104,6 @@ int lv_add_mirrors(struct cmd_context *cmd, struct logical_volume *lv, + } + } + +- if (lv->vg->lock_type && !strcmp(lv->vg->lock_type, "dlm") && cmd->lockd_lv_sh) { +- if (!cluster_mirror_is_available(cmd)) { +- log_error("Shared cluster mirrors are not available."); +- return 0; +- } +- +- if (log_count > 1) { +- log_error("Log type, \"mirrored\", is unavailable to cluster mirrors."); +- return 0; +- } +- } +- + /* For corelog mirror, activation code depends on + * the global mirror_in_sync status. As we are adding + * a new mirror, it should be set as 'out-of-sync' +diff --git a/lib/mirror/mirrored.c b/lib/mirror/mirrored.c +index 7c5c0a6..606bcf0 100644 +--- a/lib/mirror/mirrored.c ++++ b/lib/mirror/mirrored.c +@@ -285,15 +285,6 @@ static int _add_log(struct dm_pool *mem, struct lv_segment *seg, + if (!laopts->exclusive && vg_is_clustered(seg->lv->vg)) + clustered = 1; + +- else if (seg->lv->vg->lock_type && !strcmp(seg->lv->vg->lock_type, "dlm")) { +- /* +- * If shared lock was used due to -asy, then we set clustered +- * to use a clustered mirror log with cmirrod. +- */ +- if (seg->lv->vg->cmd->lockd_lv_sh) +- clustered = 1; +- } +- + if (seg->log_lv) { + /* If disk log, use its UUID */ + if (!(log_dlid = build_dm_uuid(mem, seg->log_lv, NULL))) { +diff --git a/man/lvmlockd.8_main b/man/lvmlockd.8_main +index cfb45b2..3f0e3ed 100644 +--- a/man/lvmlockd.8_main ++++ b/man/lvmlockd.8_main +@@ -545,7 +545,7 @@ report an error and fail. + The shared mode is intended for a multi-host/cluster application or + file system. + LV types that cannot be used concurrently +-from multiple hosts include thin, cache, raid, and snapshot. ++from multiple hosts include thin, cache, raid, mirror, and snapshot. + + .IP \fBn\fP + The command deactivates the LV. After deactivating the LV, the command diff --git a/SOURCES/lvm2-2_02_186-man-updates-to-lvmlockd.patch b/SOURCES/lvm2-2_02_186-man-updates-to-lvmlockd.patch new file mode 100644 index 0000000..868accd --- /dev/null +++ b/SOURCES/lvm2-2_02_186-man-updates-to-lvmlockd.patch @@ -0,0 +1,117 @@ + man/lvmlockd.8_main | 61 +++++++++++++---------------------------------------- + 1 file changed, 15 insertions(+), 46 deletions(-) + +diff --git a/man/lvmlockd.8_main b/man/lvmlockd.8_main +index 3f0e3ed..b917d93 100644 +--- a/man/lvmlockd.8_main ++++ b/man/lvmlockd.8_main +@@ -76,9 +76,6 @@ For default settings, see lvmlockd -h. + .I seconds + Override the default sanlock I/O timeout. + +-.B --adopt | -A 0|1 +- Adopt locks from a previous instance of lvmlockd. +- + + .SH USAGE + +@@ -261,6 +258,16 @@ does for foreign VGs. + + .SS creating the first sanlock VG + ++When use_lvmlockd is first enabled in lvm.conf, and before the first ++sanlock VG is created, no global lock will exist. In this initial state, ++LVM commands try and fail to acquire the global lock, producing a warning, ++and some commands are disallowed. Once the first sanlock VG is created, ++the global lock will be available, and LVM will be fully operational. ++ ++When a new sanlock VG is created, its lockspace is automatically started on ++the host that creates it. Other hosts need to run 'vgchange --lock-start' ++to start the new VG before they can use it. ++ + Creating the first sanlock VG is not protected by locking, so it requires + special attention. This is because sanlock locks exist on storage within + the VG, so they are not available until after the VG is created. The +@@ -288,19 +295,7 @@ See below for more information about managing the sanlock global lock. + + .SS using shared VGs + +-There are some special considerations when using shared VGs. +- +-When use_lvmlockd is first enabled in lvm.conf, and before the first +-shared VG is created, no global lock will exist. In this initial state, +-LVM commands try and fail to acquire the global lock, producing a warning, +-and some commands are disallowed. Once the first shared VG is created, +-the global lock will be available, and LVM will be fully operational. +- +-When a new shared VG is created, its lockspace is automatically started on +-the host that creates it. Other hosts need to run 'vgchange --lock-start' +-to start the new VG before they can use it. +- +-From the 'vgs' command, shared VGs are indicated by "s" (for shared) in ++In the 'vgs' command, shared VGs are indicated by "s" (for shared) in + the sixth attr field, and by "shared" in the "--options shared" report + field. The specific lock type and lock args for a shared VG can be + displayed with 'vgs -o+locktype,lockargs'. +@@ -379,31 +374,6 @@ activation { + .fi + + +-.SS automatic starting and automatic activation +- +-When system-level scripts/programs automatically start VGs, they should +-use the "auto" option. This option indicates that the command is being +-run automatically by the system: +- +-vgchange --lock-start --lock-opt auto [ ...] +- +-The "auto" option causes the command to follow the lvm.conf +-activation/auto_lock_start_list. If auto_lock_start_list is undefined, +-all VGs are started, just as if the auto option was not used. +- +-When auto_lock_start_list is defined, it lists the shared VGs that should +-be started by the auto command. VG names that do not match an item in the +-list will be ignored by the auto start command. +- +-(The lock_start_list is also still used to filter VG names from all start +-commands, i.e. with or without the auto option. When the lock_start_list +-is defined, only VGs matching a list item can be started with vgchange.) +- +-The auto_lock_start_list allows a user to select certain shared VGs that +-should be automatically started by the system (or indirectly, those that +-should not). +- +- + .SS internal command locking + + To optimize the use of LVM with lvmlockd, be aware of the three kinds of +@@ -411,8 +381,8 @@ locks and when they are used: + + .I Global lock + +-The global lock s associated with global information, which is information +-not isolated to a single VG. This includes: ++The global lock is associated with global information, which is ++information not isolated to a single VG. This includes: + + \[bu] + The global VG namespace. +@@ -456,7 +426,7 @@ held only while an LVM command is running.) + + .I lock retries + +-If a request for a Global or VG lock fails due to a lock conflict with ++If a request for a global or VG lock fails due to a lock conflict with + another host, lvmlockd automatically retries for a short time before + returning a failure to the LVM command. If those retries are + insufficient, the LVM command will retry the entire lock request a number +@@ -579,8 +549,7 @@ necessary locks. + .B lvmlockd failure + + If lvmlockd fails or is killed while holding locks, the locks are orphaned +-in the lock manager. lvmlockd can be restarted with an option to adopt +-locks in the lock manager that had been held by the previous instance. ++in the lock manager. + + .B dlm/corosync failure + diff --git a/SOURCES/lvm2-2_02_186-mirror-fix-monitoring-change.patch b/SOURCES/lvm2-2_02_186-mirror-fix-monitoring-change.patch new file mode 100644 index 0000000..9f6388d --- /dev/null +++ b/SOURCES/lvm2-2_02_186-mirror-fix-monitoring-change.patch @@ -0,0 +1,22 @@ + lib/activate/activate.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lib/activate/activate.c b/lib/activate/activate.c +index 6823e25..b4e3a65 100644 +--- a/lib/activate/activate.c ++++ b/lib/activate/activate.c +@@ -2061,12 +2061,12 @@ int monitor_dev_for_events(struct cmd_context *cmd, const struct logical_volume + } else + continue; + +- if (!locking_is_clustered() && !vg_write_lock_held() && lv_is_mirror(lv)) { ++ if (!cmd->is_clvmd && !vg_write_lock_held() && lv_is_mirror(lv)) { + /* + * Commands vgchange and lvchange do use read-only lock when changing + * monitoring (--monitor y|n). All other use cases hold 'write-lock' + * so they skip this dm mirror table refreshing step. +- * Shortcut can't be applied with clustered locking. ++ * Shortcut is also not applied with clvmd. + */ + if (!_lv_activate_lv(lv, &mirr_laopts)) { + stack; diff --git a/SOURCES/lvm2-build-make-generate.patch b/SOURCES/lvm2-build-make-generate.patch deleted file mode 100644 index 3a292d2..0000000 --- a/SOURCES/lvm2-build-make-generate.patch +++ /dev/null @@ -1,24 +0,0 @@ - conf/example.conf.in | 10 ++++++++++ - 1 file changed, 10 insertions(+) - -diff --git a/conf/example.conf.in b/conf/example.conf.in -index b37e0b2..fec779b 100644 ---- a/conf/example.conf.in -+++ b/conf/example.conf.in -@@ -1125,6 +1125,16 @@ global { - # When enabled, an LVM command that changes PVs, changes VG metadata, - # or changes the activation state of an LV will send a notification. - notify_dbus = 1 -+ -+ # Configuration option global/io_memory_size. -+ # The amount of memory in KiB that LVM allocates to perform disk io. -+ # LVM performance may benefit from more io memory when there are many -+ # disks or VG metadata is large. Increasing this size may be necessary -+ # when a single copy of VG metadata is larger than the current setting. -+ # This value should usually not be decreased from the default; setting -+ # it too low can result in lvm failing to read VGs. -+ # This configuration option has an automatic default value. -+ # io_memory_size = 8192 - } - - # Configuration section activation. diff --git a/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch b/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch index 0bf0618..72b7d21 100644 --- a/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch +++ b/SOURCES/lvm2-default-allow-changes-with-duplicate-pvs.patch @@ -3,10 +3,10 @@ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/example.conf.in b/conf/example.conf.in -index 4894d04..48afbd1 100644 +index 7ccf928..4418f56 100644 --- a/conf/example.conf.in +++ b/conf/example.conf.in -@@ -311,7 +311,7 @@ devices { +@@ -325,7 +325,7 @@ devices { # or activating LVs in it while a PV appears on multiple devices. # Enabling this setting allows the VG to be used as usual even with # uncertain devices. @@ -16,7 +16,7 @@ index 4894d04..48afbd1 100644 # Configuration section allocation. diff --git a/lib/config/defaults.h b/lib/config/defaults.h -index d9e19d9..894b979 100644 +index 6d3c37c..0d55928 100644 --- a/lib/config/defaults.h +++ b/lib/config/defaults.h @@ -45,7 +45,7 @@ diff --git a/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch b/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch index 0c7a0b0..1a955a7 100644 --- a/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch +++ b/SOURCES/lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch @@ -4,7 +4,7 @@ 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/configure b/configure -index 7d945df..ef24b31 100755 +index 4d2fb2f..f357462 100755 --- a/configure +++ b/configure @@ -12111,12 +12111,12 @@ if test -n "$BLKID_CFLAGS"; then @@ -70,7 +70,7 @@ index 7d945df..ef24b31 100755 else BLKID_CFLAGS=$pkg_cv_BLKID_CFLAGS diff --git a/configure.ac b/configure.ac -index e427708..935ea08 100644 +index 379d37f..e6bb905 100644 --- a/configure.ac +++ b/configure.ac @@ -1235,7 +1235,7 @@ AC_ARG_ENABLE(blkid_wiping, @@ -92,7 +92,7 @@ index e427708..935ea08 100644 fi AC_MSG_CHECKING([whether to enable libblkid detection of signatures when wiping]) diff --git a/lib/device/dev-type.c b/lib/device/dev-type.c -index af4b407..eda7982 100644 +index ce4a05b..9bdee32 100644 --- a/lib/device/dev-type.c +++ b/lib/device/dev-type.c @@ -712,8 +712,7 @@ static int _wipe_known_signatures_with_blkid(struct device *dev, const char *nam diff --git a/SOURCES/lvm2-make-generate.patch b/SOURCES/lvm2-make-generate.patch new file mode 100644 index 0000000..ac74f50 --- /dev/null +++ b/SOURCES/lvm2-make-generate.patch @@ -0,0 +1,239 @@ + conf/example.conf.in | 20 ++++++++++++++++---- + man/pvcreate.8_pregen | 7 ++++--- + man/vgcfgrestore.8_pregen | 9 +++++---- + man/vgconvert.8_pregen | 14 +++++++++----- + man/vgcreate.8_pregen | 7 ++++--- + man/vgextend.8_pregen | 7 ++++--- + man/vgsplit.8_pregen | 7 ++++--- + 7 files changed, 46 insertions(+), 25 deletions(-) + +diff --git a/conf/example.conf.in b/conf/example.conf.in +index 4418f56..6f7b161 100644 +--- a/conf/example.conf.in ++++ b/conf/example.conf.in +@@ -716,17 +716,29 @@ global { + activation = 1 + + # Configuration option global/fallback_to_lvm1. +- # This setting is no longer used. ++ # Try running LVM1 tools if LVM cannot communicate with DM. ++ # This option only applies to 2.4 kernels and is provided to help ++ # switch between device-mapper kernels and LVM1 kernels. The LVM1 ++ # tools need to be installed with .lvm1 suffices, e.g. vgscan.lvm1. ++ # They will stop working once the lvm2 on-disk metadata format is used. + # This configuration option has an automatic default value. +- # fallback_to_lvm1 = 0 ++ # fallback_to_lvm1 = @DEFAULT_FALLBACK_TO_LVM1@ + + # Configuration option global/format. +- # This setting is no longer used. ++ # The default metadata format that commands should use. ++ # The -M 1|2 option overrides this setting. ++ # ++ # Accepted values: ++ # lvm1 ++ # lvm2 ++ # + # This configuration option has an automatic default value. + # format = "lvm2" + + # Configuration option global/format_libraries. +- # This setting is no longer used. ++ # Shared libraries that process different metadata formats. ++ # If support for LVM1 metadata was compiled as a shared library use ++ # format_libraries = "liblvm2format1.so" + # This configuration option does not have a default value defined. + + # Configuration option global/segment_libraries. +diff --git a/man/pvcreate.8_pregen b/man/pvcreate.8_pregen +index c4b03da..abceb82 100644 +--- a/man/pvcreate.8_pregen ++++ b/man/pvcreate.8_pregen +@@ -38,7 +38,7 @@ normally prevent it, e.g. if the PV is already in a VG. + .ad b + .br + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -266,11 +266,12 @@ The size may be rounded. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l +diff --git a/man/vgcfgrestore.8_pregen b/man/vgcfgrestore.8_pregen +index cffd44b..e028103 100644 +--- a/man/vgcfgrestore.8_pregen ++++ b/man/vgcfgrestore.8_pregen +@@ -51,7 +51,7 @@ vgcfgrestore - Restore volume group configuration + .ad b + .br + .ad l +- \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .ad b + .br + .ad l +@@ -141,7 +141,7 @@ Common options for command: + . + .RS 4 + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -280,11 +280,12 @@ Display long help text. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l +diff --git a/man/vgconvert.8_pregen b/man/vgconvert.8_pregen +index 5e7f8a9..6228087 100644 +--- a/man/vgconvert.8_pregen ++++ b/man/vgconvert.8_pregen +@@ -8,9 +8,12 @@ vgconvert - Change volume group metadata format + [ \fIoption_args\fP ] + .br + .SH DESCRIPTION +-vgconvert converts VG metadata from one format to another. This command +-is no longer used because this version of lvm no longer supports the LVM1 ++vgconvert converts VG metadata from one format to another. The new ++metadata format must be able to fit into the space provided by the old + format. ++ ++Because the LVM1 format should no longer be used, this command is no ++longer needed in general. + .SH USAGE + \fBvgconvert\fP \fIVG\fP ... + .br +@@ -20,7 +23,7 @@ format. + .ad b + .br + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -191,11 +194,12 @@ The size may be rounded. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l +diff --git a/man/vgcreate.8_pregen b/man/vgcreate.8_pregen +index 09bf126..ddad391 100644 +--- a/man/vgcreate.8_pregen ++++ b/man/vgcreate.8_pregen +@@ -33,7 +33,7 @@ devices are also available with vgcreate. + .ad b + .br + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -324,11 +324,12 @@ The size may be rounded. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l +diff --git a/man/vgextend.8_pregen b/man/vgextend.8_pregen +index a6a30e9..ee805a8 100644 +--- a/man/vgextend.8_pregen ++++ b/man/vgextend.8_pregen +@@ -36,7 +36,7 @@ will initialize them. In this case pvcreate options can be used, e.g. + .ad b + .br + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -237,11 +237,12 @@ The size may be rounded. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l +diff --git a/man/vgsplit.8_pregen b/man/vgsplit.8_pregen +index 6c3e6ec..210c266 100644 +--- a/man/vgsplit.8_pregen ++++ b/man/vgsplit.8_pregen +@@ -62,7 +62,7 @@ Common options for command: + .ad b + .br + .ad l +-[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ] ++[ \fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP ] + .ad b + .br + .ad l +@@ -230,11 +230,12 @@ and --vgmetadatacopies for improving performance. + .ad b + .HP + .ad l +-\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP ++\fB-M\fP|\fB--metadatatype\fP \fBlvm2\fP|\fBlvm1\fP + .br + Specifies the type of on-disk metadata to use. + \fBlvm2\fP (or just \fB2\fP) is the current, standard format. +-\fBlvm1\fP (or just \fB1\fP) is no longer used. ++\fBlvm1\fP (or just \fB1\fP) is a historical format that ++can be used for accessing old data. + .ad b + .HP + .ad l diff --git a/SOURCES/lvm2-rhel-config-Change-version-for-backported-config-options.patch b/SOURCES/lvm2-rhel-config-Change-version-for-backported-config-options.patch deleted file mode 100644 index d1359b7..0000000 --- a/SOURCES/lvm2-rhel-config-Change-version-for-backported-config-options.patch +++ /dev/null @@ -1,25 +0,0 @@ - lib/config/config_settings.h | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index c3e9600..5fddff0 100644 ---- a/lib/config/config_settings.h -+++ b/lib/config/config_settings.h -@@ -947,7 +947,7 @@ cfg(global_lvdisplay_shows_full_device_path_CFG, "lvdisplay_shows_full_device_pa - "Previously this was always shown as /dev/vgname/lvname even when that\n" - "was never a valid path in the /dev filesystem.\n") - --cfg(global_use_aio_CFG, "use_aio", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_USE_AIO, vsn(2, 2, 183), NULL, 0, NULL, -+cfg(global_use_aio_CFG, "use_aio", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_USE_AIO, vsn(2, 2, 180), NULL, 0, NULL, - "Use async I/O when reading and writing devices.\n") - - cfg(global_use_lvmetad_CFG, "use_lvmetad", global_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_USE_LVMETAD, vsn(2, 2, 93), "@DEFAULT_USE_LVMETAD@", 0, NULL, -@@ -1138,7 +1138,7 @@ cfg(global_notify_dbus_CFG, "notify_dbus", global_CFG_SECTION, 0, CFG_TYPE_BOOL, - "When enabled, an LVM command that changes PVs, changes VG metadata,\n" - "or changes the activation state of an LV will send a notification.\n") - --cfg(global_io_memory_size_CFG, "io_memory_size", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_IO_MEMORY_SIZE_KB, vsn(2, 2, 184), NULL, 0, NULL, -+cfg(global_io_memory_size_CFG, "io_memory_size", global_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_IO_MEMORY_SIZE_KB, vsn(2, 2, 180), NULL, 0, NULL, - "The amount of memory in KiB that LVM allocates to perform disk io.\n" - "LVM performance may benefit from more io memory when there are many\n" - "disks or VG metadata is large. Increasing this size may be necessary\n" diff --git a/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch b/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch index 675ed3d..093bc60 100644 --- a/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch +++ b/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch @@ -91,7 +91,7 @@ create mode 100644 test/shell/snapshot-lvm1.sh diff --git a/configure b/configure -index ef24b31..10b49c6 100755 +index f357462..2585e58 100755 --- a/configure +++ b/configure @@ -675,6 +675,7 @@ PYTHON_BINDINGS @@ -237,12 +237,12 @@ index ef24b31..10b49c6 100755 + + ################################################################################ --ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" -+ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" +-ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmeventd/plugins/vdo/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" ++ac_config_files="$ac_config_files Makefile make.tmpl daemons/Makefile daemons/clvmd/Makefile daemons/cmirrord/Makefile daemons/dmeventd/Makefile daemons/dmeventd/libdevmapper-event.pc daemons/dmeventd/plugins/Makefile daemons/dmeventd/plugins/lvm2/Makefile daemons/dmeventd/plugins/raid/Makefile daemons/dmeventd/plugins/mirror/Makefile daemons/dmeventd/plugins/snapshot/Makefile daemons/dmeventd/plugins/thin/Makefile daemons/dmeventd/plugins/vdo/Makefile daemons/dmfilemapd/Makefile daemons/lvmdbusd/Makefile daemons/lvmdbusd/lvmdbusd daemons/lvmdbusd/lvmdb.py daemons/lvmdbusd/lvm_shell_proxy.py daemons/lvmdbusd/path.py daemons/lvmetad/Makefile daemons/lvmpolld/Makefile daemons/lvmlockd/Makefile device_mapper/Makefile conf/Makefile conf/example.conf conf/lvmlocal.conf conf/command_profile_template.profile conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile lib/format1/Makefile lib/format_pool/Makefile lib/locking/Makefile include/lvm-version.h libdaemon/Makefile libdaemon/client/Makefile libdaemon/server/Makefile libdm/Makefile libdm/libdevmapper.pc liblvm/Makefile liblvm/liblvm2app.pc man/Makefile po/Makefile python/Makefile python/setup.py scripts/blkdeactivate.sh scripts/blk_availability_init_red_hat scripts/blk_availability_systemd_red_hat.service scripts/clvmd_init_red_hat scripts/cmirrord_init_red_hat scripts/com.redhat.lvmdbus1.service scripts/dm_event_systemd_red_hat.service scripts/dm_event_systemd_red_hat.socket scripts/lvm2_cluster_activation_red_hat.sh scripts/lvm2_cluster_activation_systemd_red_hat.service scripts/lvm2_clvmd_systemd_red_hat.service scripts/lvm2_cmirrord_systemd_red_hat.service scripts/lvm2_lvmdbusd_systemd_red_hat.service scripts/lvm2_lvmetad_init_red_hat scripts/lvm2_lvmetad_systemd_red_hat.service scripts/lvm2_lvmetad_systemd_red_hat.socket scripts/lvm2_lvmpolld_init_red_hat scripts/lvm2_lvmpolld_systemd_red_hat.service scripts/lvm2_lvmpolld_systemd_red_hat.socket scripts/lvm2_lvmlockd_systemd_red_hat.service scripts/lvm2_lvmlocking_systemd_red_hat.service scripts/lvm2_monitoring_init_red_hat scripts/lvm2_monitoring_systemd_red_hat.service scripts/lvm2_pvscan_systemd_red_hat@.service scripts/lvm2_tmpfiles_red_hat.conf scripts/lvmdump.sh scripts/Makefile test/Makefile test/api/Makefile test/api/python_lvm_unit.py test/unit/Makefile tools/Makefile udev/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -16285,6 +16374,8 @@ do +@@ -16286,6 +16375,8 @@ do "include/.symlinks") CONFIG_FILES="$CONFIG_FILES include/.symlinks" ;; "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;; "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;; @@ -252,7 +252,7 @@ index ef24b31..10b49c6 100755 "include/lvm-version.h") CONFIG_FILES="$CONFIG_FILES include/lvm-version.h" ;; "libdaemon/Makefile") CONFIG_FILES="$CONFIG_FILES libdaemon/Makefile" ;; diff --git a/configure.ac b/configure.ac -index 935ea08..9fa0c76 100644 +index e6bb905..ad356b8 100644 --- a/configure.ac +++ b/configure.ac @@ -283,6 +283,58 @@ AC_MSG_RESULT($MANGLING) @@ -339,7 +339,7 @@ index 935ea08..9fa0c76 100644 AC_SUBST(M_LIBS) AC_SUBST(PTHREAD_LIBS) AC_SUBST(PYTHON2) -@@ -2117,6 +2173,8 @@ conf/metadata_profile_template.profile +@@ -2118,6 +2174,8 @@ conf/metadata_profile_template.profile include/.symlinks include/Makefile lib/Makefile @@ -406,7 +406,7 @@ index be2623a..a2adfe6 100644 #define LVMETAD_DISABLE_REASON_VGRESTORE "VGRESTORE" #define LVMETAD_DISABLE_REASON_REPAIR "REPAIR" diff --git a/daemons/lvmetad/lvmetad-core.c b/daemons/lvmetad/lvmetad-core.c -index 72473d7..f4f5f42 100644 +index 9ae359b..3e379fe 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -200,12 +200,12 @@ struct vg_info { @@ -446,7 +446,7 @@ index 72473d7..f4f5f42 100644 (s->flags & GLFL_DISABLE_REASON_VGRESTORE) ? LVMETAD_DISABLE_REASON_VGRESTORE "," : ""); } diff --git a/include/configure.h.in b/include/configure.h.in -index 15fd150..605f1e1 100644 +index 812cacc..bbeb565 100644 --- a/include/configure.h.in +++ b/include/configure.h.in @@ -72,6 +72,10 @@ @@ -460,7 +460,7 @@ index 15fd150..605f1e1 100644 /* Name of default locking directory. */ #undef DEFAULT_LOCK_DIR -@@ -616,6 +620,13 @@ +@@ -619,6 +623,13 @@ slash. */ #undef LSTAT_FOLLOWS_SLASHED_SYMLINK @@ -474,7 +474,7 @@ index 15fd150..605f1e1 100644 /* Path to lvmetad pidfile. */ #undef LVMETAD_PIDFILE -@@ -678,6 +689,9 @@ +@@ -681,6 +692,9 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION @@ -539,7 +539,7 @@ index 1d42235..241cf09 100644 locking endif diff --git a/lib/activate/activate.c b/lib/activate/activate.c -index 56ec732..18f4b84 100644 +index dc9bc9e..6823e25 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -37,6 +37,19 @@ @@ -563,7 +563,7 @@ index 56ec732..18f4b84 100644 struct dm_list *modules) { diff --git a/lib/activate/activate.h b/lib/activate/activate.h -index d2c6db7..2fc74ce 100644 +index 524d2bf..43d26d1 100644 --- a/lib/activate/activate.h +++ b/lib/activate/activate.h @@ -91,6 +91,7 @@ int activation(void); @@ -575,7 +575,7 @@ index d2c6db7..2fc74ce 100644 int module_present(struct cmd_context *cmd, const char *target_name); int target_present_version(struct cmd_context *cmd, const char *target_name, diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c -index 3e681a2..2fba3ff 100644 +index ad40d4c..62f1d3c 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -22,6 +22,8 @@ @@ -597,10 +597,10 @@ index 3e681a2..2fba3ff 100644 _drop_metadata(vgname, drop_precommitted); } diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c -index a1ab41a..2a2d7ea 100644 +index 86a880a..ec1a749 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c -@@ -37,6 +37,8 @@ static const char *_lvmetad_socket = NULL; +@@ -38,6 +38,8 @@ static const char *_lvmetad_socket = NULL; static struct cmd_context *_lvmetad_cmd = NULL; static int64_t _lvmetad_update_timeout; @@ -609,7 +609,7 @@ index a1ab41a..2a2d7ea 100644 static struct volume_group *_lvmetad_pvscan_vg(struct cmd_context *cmd, struct volume_group *vg, const char *vgid, struct format_type *fmt); static uint64_t _monotonic_seconds(void) -@@ -2277,6 +2279,18 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev, +@@ -2287,6 +2289,18 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev, if (!baton.fid) goto_bad; @@ -628,7 +628,7 @@ index a1ab41a..2a2d7ea 100644 lvmcache_foreach_mda(info, _lvmetad_pvscan_single, &baton); if (!baton.vg) -@@ -2440,9 +2454,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) +@@ -2451,9 +2465,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) } /* @@ -642,7 +642,7 @@ index a1ab41a..2a2d7ea 100644 log_debug_lvmetad("Enabling lvmetad which was previously disabled."); lvmetad_clear_disabled(cmd); } -@@ -3058,6 +3074,9 @@ int lvmetad_is_disabled(struct cmd_context *cmd, const char **reason) +@@ -3101,6 +3117,9 @@ int lvmetad_is_disabled(struct cmd_context *cmd, const char **reason) } else if (strstr(reply_reason, LVMETAD_DISABLE_REASON_REPAIR)) { *reason = "a repair command was run"; @@ -653,7 +653,7 @@ index a1ab41a..2a2d7ea 100644 *reason = "duplicate PVs were found"; diff --git a/lib/commands/toolcontext.c b/lib/commands/toolcontext.c -index c9596e2..2b72645 100644 +index 25e8b87..511ccd9 100644 --- a/lib/commands/toolcontext.c +++ b/lib/commands/toolcontext.c @@ -36,6 +36,14 @@ @@ -671,7 +671,7 @@ index c9596e2..2b72645 100644 #include #include #include -@@ -1134,12 +1142,14 @@ static struct dev_filter *_init_lvmetad_filter_chain(struct cmd_context *cmd) +@@ -1138,12 +1146,14 @@ static struct dev_filter *_init_lvmetad_filter_chain(struct cmd_context *cmd) } nr_filt++; @@ -686,7 +686,7 @@ index c9596e2..2b72645 100644 /* md component filter. Optional, non-critical. */ if (find_config_tree_bool(cmd, devices_md_component_detection_CFG, NULL)) { -@@ -1340,6 +1350,20 @@ static int _init_formats(struct cmd_context *cmd) +@@ -1344,6 +1354,20 @@ static int _init_formats(struct cmd_context *cmd) const struct dm_config_node *cn; #endif @@ -708,10 +708,10 @@ index c9596e2..2b72645 100644 /* Load any formats in shared libs if not static */ if (!is_static() && diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index e98ca6d..6d79087 100644 +index 02e2b29..9904a62 100644 --- a/lib/config/config_settings.h +++ b/lib/config/config_settings.h -@@ -767,14 +767,26 @@ cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, D +@@ -780,14 +780,26 @@ cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, D "is not present in the kernel, disabling this should suppress\n" "the error messages.\n") @@ -5470,10 +5470,10 @@ index 7866d56..e535237 100644 if (vg->lock_type) { outf(f, "lock_type = \"%s\"", vg->lock_type); diff --git a/lib/format_text/format-text.c b/lib/format_text/format-text.c -index 5c7b72f..792d75a 100644 +index b9d85a4..200b011 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c -@@ -2545,9 +2545,9 @@ struct format_type *create_text_format(struct cmd_context *cmd) +@@ -2559,9 +2559,9 @@ struct format_type *create_text_format(struct cmd_context *cmd) fmt->name = FMT_TEXT_NAME; fmt->alias = FMT_TEXT_ALIAS; fmt->orphan_vg_name = ORPHAN_VG_NAME(FMT_TEXT_NAME); @@ -5565,10 +5565,10 @@ index 2584227..2b53553 100644 case LCK_LV: /* All LV locks are non-blocking. */ diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c -index e4293cc..1c6dc62 100644 +index 9e7eff9..a8c50e7 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c -@@ -5981,6 +5981,8 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6003,6 +6003,8 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, force_t force, int suppress_remove_message) { struct volume_group *vg; @@ -5577,7 +5577,7 @@ index e4293cc..1c6dc62 100644 int visible, historical; struct logical_volume *pool_lv = NULL; struct logical_volume *lock_lv = lv; -@@ -6133,6 +6135,10 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6155,6 +6157,10 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, } if (lv_is_cow(lv)) { @@ -5588,7 +5588,7 @@ index e4293cc..1c6dc62 100644 log_verbose("Removing snapshot volume %s.", display_lvname(lv)); /* vg_remove_snapshot() will preload origin/former snapshots */ if (!vg_remove_snapshot(lv)) -@@ -6188,10 +6194,30 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6210,10 +6216,30 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, } } @@ -5620,7 +5620,7 @@ index e4293cc..1c6dc62 100644 /* TODO: defer when multiple LVs relased at once */ if (pool_lv && !update_pool_lv(pool_lv, 1)) { diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h -index f4fb112..377644b 100644 +index 75caba1..2245c29 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -149,7 +149,7 @@ @@ -5652,7 +5652,7 @@ index f4fb112..377644b 100644 #define MIRROR_BY_SEG 0x00000001U /* segment-by-segment mirror */ #define MIRROR_BY_LV 0x00000002U /* mirror using whole mimage LVs */ diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c -index 2292568..e33a779 100644 +index cb38f66..3620240 100644 --- a/lib/metadata/metadata.c +++ b/lib/metadata/metadata.c @@ -1011,6 +1011,8 @@ struct volume_group *vg_create(struct cmd_context *cmd, const char *vg_name) @@ -5664,7 +5664,7 @@ index 2292568..e33a779 100644 vg->extent_size = DEFAULT_EXTENT_SIZE * 2; vg->max_lv = DEFAULT_MAX_LV; -@@ -2971,7 +2973,7 @@ int vg_write(struct volume_group *vg) +@@ -2969,7 +2971,7 @@ int vg_write(struct volume_group *vg) return 0; } @@ -5673,7 +5673,7 @@ index 2292568..e33a779 100644 return_0; if (!vg_mda_used_count(vg)) { -@@ -5375,6 +5377,15 @@ int is_system_id_allowed(struct cmd_context *cmd, const char *system_id) +@@ -5373,6 +5375,15 @@ int is_system_id_allowed(struct cmd_context *cmd, const char *system_id) static int _access_vg_systemid(struct cmd_context *cmd, struct volume_group *vg) { /* @@ -5689,7 +5689,7 @@ index 2292568..e33a779 100644 * A few commands allow read-only access to foreign VGs. */ if (cmd->include_foreign_vgs) -@@ -5426,6 +5437,11 @@ static int _vg_access_permitted(struct cmd_context *cmd, struct volume_group *vg +@@ -5424,6 +5435,11 @@ static int _vg_access_permitted(struct cmd_context *cmd, struct volume_group *vg uint32_t lockd_state, uint32_t *failure) { if (!is_real_vg(vg->name)) { @@ -5979,10 +5979,10 @@ index 0000000..75c97cb + +vgremove -ff $vg diff --git a/tools/args.h b/tools/args.h -index 603a0cf..b80b8da 100644 +index c2fbac6..abe193c 100644 --- a/tools/args.h +++ b/tools/args.h -@@ -1207,7 +1207,8 @@ arg(mirrors_ARG, 'm', "mirrors", number_VAL, 0, 0, +@@ -1211,7 +1211,8 @@ arg(mirrors_ARG, 'm', "mirrors", number_VAL, 0, 0, arg(metadatatype_ARG, 'M', "metadatatype", metadatatype_VAL, 0, 0, "Specifies the type of on-disk metadata to use.\n" "\\fBlvm2\\fP (or just \\fB2\\fP) is the current, standard format.\n" @@ -5993,10 +5993,10 @@ index 603a0cf..b80b8da 100644 arg(name_ARG, 'n', "name", string_VAL, 0, 0, "#lvcreate\n" diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index b149201..3ce228f 100644 +index bc666c0..4b04576 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c -@@ -1770,6 +1770,11 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu +@@ -1816,6 +1816,11 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu return 0; } @@ -6009,7 +6009,7 @@ index b149201..3ce228f 100644 /* FIXME: we need to create a lock for the new LV. */ log_error("Unable to split snapshots in VG with lock_type %s.", vg->lock_type); diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c -index 0dd24ec..0600b1c 100644 +index a9c3e41..f238b64 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -23,6 +23,7 @@ @@ -6020,7 +6020,7 @@ index 0dd24ec..0600b1c 100644 #include #include -@@ -2899,6 +2900,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) +@@ -2913,6 +2914,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) goto out; } @@ -6032,9 +6032,9 @@ index 0dd24ec..0600b1c 100644 + } + if (cmd->command->command_enum == lvconvert_repair_CMD) { - log_warn("WARNING: Disabling lvmetad cache for repair command."); - lvmetad_set_disabled(cmd, LVMETAD_DISABLE_REASON_REPAIR); -@@ -2963,7 +2971,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) + log_warn("WARNING: Not using lvmetad because of repair."); + lvmetad_make_unused(cmd); +@@ -2975,7 +2983,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) * by different token values.) * * lvmetad may have been previously disabled (or disabled during the @@ -6043,7 +6043,7 @@ index 0dd24ec..0600b1c 100644 * In this case, disable the *use* of lvmetad by this command, reverting to * disk scanning. */ -@@ -3388,6 +3396,41 @@ static int _run_script(struct cmd_context *cmd, int argc, char **argv) +@@ -3400,6 +3408,41 @@ static int _run_script(struct cmd_context *cmd, int argc, char **argv) return ret; } @@ -6085,7 +6085,7 @@ index 0dd24ec..0600b1c 100644 static void _nonroot_warning(void) { if (getuid() || geteuid()) -@@ -3477,6 +3520,19 @@ int lvm2_main(int argc, char **argv) +@@ -3489,6 +3532,19 @@ int lvm2_main(int argc, char **argv) } else run_name = dm_basename(argv[0]); @@ -6106,10 +6106,10 @@ index 0dd24ec..0600b1c 100644 * Decide if we are running a shell or a command or a script. When * there is no run_name, it's a shell, when run_name is a recognized diff --git a/tools/pvscan.c b/tools/pvscan.c -index 2915db5..d9ad097 100644 +index daac88f..c43d602 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c -@@ -631,7 +631,7 @@ out: +@@ -650,7 +650,7 @@ out: * display the PV info. * * iii. If lvmetad is being used, but has been disabled (because of @@ -6118,7 +6118,7 @@ index 2915db5..d9ad097 100644 * (because the device filter is different from the device filter last * used to populate lvmetad), then 'pvscan' will begin by rescanning * devices to repopulate lvmetad. If lvmetad is enabled after the -@@ -644,7 +644,8 @@ out: +@@ -663,7 +663,8 @@ out: * attempt to repopulate the lvmetad cache by rescanning all devs * (regardless of whether lvmetad was previously disabled or had an * unmatching token.) lvmetad may be enabled or disabled after the @@ -6141,7 +6141,7 @@ index 1d58387..f03e5d3 100644 } diff --git a/tools/toollib.c b/tools/toollib.c -index 413937f..b60ff06 100644 +index 3221e5f..bd9c9fe 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -14,6 +14,7 @@ @@ -6152,7 +6152,7 @@ index 413937f..b60ff06 100644 #include "format-text.h" #include -@@ -4110,6 +4111,7 @@ static int _process_duplicate_pvs(struct cmd_context *cmd, +@@ -4168,6 +4169,7 @@ static int _process_duplicate_pvs(struct cmd_context *cmd, .fid = &dummy_fid, .name = "", .system_id = (char *) "", @@ -6160,7 +6160,7 @@ index 413937f..b60ff06 100644 .pvs = DM_LIST_HEAD_INIT(dummy_vg.pvs), .lvs = DM_LIST_HEAD_INIT(dummy_vg.lvs), .historical_lvs = DM_LIST_HEAD_INIT(dummy_vg.historical_lvs), -@@ -4747,6 +4749,23 @@ int pvcreate_params_from_args(struct cmd_context *cmd, struct pvcreate_params *p +@@ -4805,6 +4807,23 @@ int pvcreate_params_from_args(struct cmd_context *cmd, struct pvcreate_params *p pp->pva.label_sector = arg_int64_value(cmd, labelsector_ARG, DEFAULT_LABELSECTOR); @@ -6184,7 +6184,7 @@ index 413937f..b60ff06 100644 if (arg_is_set(cmd, metadataignore_ARG)) pp->pva.metadataignore = arg_int_value(cmd, metadataignore_ARG, DEFAULT_PVMETADATAIGNORE); -@@ -5106,7 +5125,10 @@ static int _pvcreate_check_single(struct cmd_context *cmd, +@@ -5164,7 +5183,10 @@ static int _pvcreate_check_single(struct cmd_context *cmd, pd->is_orphan_pv = 1; } @@ -6196,7 +6196,7 @@ index 413937f..b60ff06 100644 } else { log_debug("Found pvcreate arg %s: device is not a PV.", pd->name); /* Device is not a PV. */ -@@ -5335,7 +5357,10 @@ static int _pvremove_check_single(struct cmd_context *cmd, +@@ -5393,7 +5415,10 @@ static int _pvremove_check_single(struct cmd_context *cmd, pd->is_orphan_pv = 1; } @@ -6231,10 +6231,10 @@ index 79c48b5..95dc8b2 100644 val(segtype_VAL, segtype_arg, "SegType", "linear|striped|snapshot|mirror|raid|thin|cache|thin-pool|cache-pool") val(alloc_VAL, alloc_arg, "Alloc", "contiguous|cling|cling_by_tags|normal|anywhere|inherit") diff --git a/tools/vgchange.c b/tools/vgchange.c -index 623517b..67be3ec 100644 +index 24c2253..4498f06 100644 --- a/tools/vgchange.c +++ b/tools/vgchange.c -@@ -534,6 +534,13 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg) +@@ -545,6 +545,13 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg) const char *system_id; const char *system_id_arg_str = arg_str_value(cmd, systemid_ARG, NULL); @@ -6248,7 +6248,7 @@ index 623517b..67be3ec 100644 if (!(system_id = system_id_from_string(cmd, system_id_arg_str))) { log_error("Unable to set system ID."); return 0; -@@ -583,6 +590,9 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg) +@@ -594,6 +601,9 @@ static int _vgchange_system_id(struct cmd_context *cmd, struct volume_group *vg) vg->system_id = system_id; diff --git a/SOURCES/lvm2-rhel7-fix-StartLimitInterval.patch b/SOURCES/lvm2-rhel7-fix-StartLimitInterval.patch deleted file mode 100644 index 5e6616b..0000000 --- a/SOURCES/lvm2-rhel7-fix-StartLimitInterval.patch +++ /dev/null @@ -1,20 +0,0 @@ - scripts/lvm2_pvscan_systemd_red_hat@.service.in | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/scripts/lvm2_pvscan_systemd_red_hat@.service.in b/scripts/lvm2_pvscan_systemd_red_hat@.service.in -index 839bfd1..f0bbd46 100644 ---- a/scripts/lvm2_pvscan_systemd_red_hat@.service.in -+++ b/scripts/lvm2_pvscan_systemd_red_hat@.service.in -@@ -2,7 +2,6 @@ - Description=LVM2 PV scan on device %i - Documentation=man:pvscan(8) - DefaultDependencies=no --StartLimitInterval=0 - BindsTo=dev-block-%i.device - Requires=lvm2-lvmetad.socket - After=lvm2-lvmetad.socket lvm2-lvmetad.service -@@ -14,3 +13,4 @@ Type=oneshot - RemainAfterExit=yes - ExecStart=@SBINDIR@/lvm pvscan --cache --activate ay %i - ExecStop=@SBINDIR@/lvm pvscan --cache %i -+StartLimitInterval=0 diff --git a/SOURCES/lvm2-rhel7.patch b/SOURCES/lvm2-rhel7.patch index e14a8e9..4f0ba4d 100644 --- a/SOURCES/lvm2-rhel7.patch +++ b/SOURCES/lvm2-rhel7.patch @@ -3,16 +3,16 @@ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION -index 9e5739e..98731d0 100644 +index 583267e..a7cba47 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ --2.02.180(2) (2018-07-19) -+2.02.180(2)-RHEL7 (2018-07-20) +-2.02.185(2) (2019-05-13) ++2.02.185(2)-RHEL7 (2019-05-13) diff --git a/VERSION_DM b/VERSION_DM -index 88fc33b..1da204c 100644 +index 8c4af2c..6b38abe 100644 --- a/VERSION_DM +++ b/VERSION_DM @@ -1 +1 @@ --1.02.149 (2018-07-19) -+1.02.149-RHEL7 (2018-07-20) +-1.02.158 (2019-05-13) ++1.02.158-RHEL7 (2019-05-13) diff --git a/SOURCES/lvm2-set-default-preferred_names.patch b/SOURCES/lvm2-set-default-preferred_names.patch index a1b3034..205dd10 100644 --- a/SOURCES/lvm2-set-default-preferred_names.patch +++ b/SOURCES/lvm2-set-default-preferred_names.patch @@ -3,7 +3,7 @@ 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/conf/example.conf.in b/conf/example.conf.in -index aab274d..4894d04 100644 +index 38855e9..7ccf928 100644 --- a/conf/example.conf.in +++ b/conf/example.conf.in @@ -106,7 +106,7 @@ devices { @@ -16,7 +16,7 @@ index aab274d..4894d04 100644 # Configuration option devices/filter. # Limit the block devices that are used by LVM commands. diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index 077fb15..65cda08 100644 +index 0e81252..02e2b29 100644 --- a/lib/config/config_settings.h +++ b/lib/config/config_settings.h @@ -255,7 +255,7 @@ cfg(devices_external_device_info_source_CFG, "external_device_info_source", devi diff --git a/SPECS/lvm2.spec b/SPECS/lvm2.spec index 70a65a2..9d8bece 100644 --- a/SPECS/lvm2.spec +++ b/SPECS/lvm2.spec @@ -1,4 +1,4 @@ -%global device_mapper_version 1.02.149 +%global device_mapper_version 1.02.158 %global enable_cache 1 %global enable_cluster 1 @@ -27,7 +27,7 @@ %global boom_pkgname lvm2-python-boom %global boom_version 0.9 -%global boom_release 14 +%global boom_release 18 %global boom_summary A set of libraries and tools for managing boot loader entries %global boom_dir boom-%{boom_version} @@ -66,8 +66,8 @@ Summary: Userland logical volume management tools Name: lvm2 Epoch: 7 -Version: 2.02.180 -Release: 10%{?dist}.8%{?scratch} +Version: 2.02.185 +Release: 2%{?dist}%{?scratch} License: GPLv2 Group: System Environment/Base URL: http://sources.redhat.com/lvm2 @@ -78,66 +78,13 @@ Patch1: lvm2-set-default-preferred_names.patch Patch2: lvm2-fix-libdm-versioning-for-dm_tree_node_size_changed-symbol.patch Patch3: lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection.patch Patch4: lvm2-default-allow-changes-with-duplicate-pvs.patch -Patch5: lvm2-rhel7-fix-StartLimitInterval.patch +#Patch5: lvm2-rhel7-fix-StartLimitInterval.patch Patch6: lvm2-rhel7-add-lvm1-and-pool-back.patch -Patch7: lvm2-2_02_180-make-generate.patch -Patch8: lvm2-2_02_181-post-release.patch -Patch9: lvm2-2_02_181-lvconvert-restrict-command-matching-for-no-option-va.patch -Patch10: lvm2-2_02_181-lvconvert-improve-text-about-splitmirrors.patch -Patch11: lvm2-2_02_181-lvconvert-reject-conversions-of-LVs-under-snapshot.patch -Patch12: lvm2-2_02_181-dmsetup-fix-error-propagation-in-_display_info_cols.patch -Patch13: lvm2-2_02_181-reject-conversions-trackchanges-SubLVs.patch -Patch14: lvm2-2_02_181-reject-conversions-trackchanges-LVs.patch -Patch15: lvm2-2_02_181-dmeventd-base-vdo-plugin.patch -Patch16: lvm2-2_02_181-dmeventd-rebase-to-stable-branch.patch -Patch17: lvm2-2_02_181-WHATS_NEW.patch -Patch18: lvm2-2_02_181-build-make-generate.patch -Patch19: lvm2-2_02_182-vgcreate-close-exclusive-fd-after-pvcreate.patch -Patch20: lvm2-2_02_182-mirrors-fix-read_only_volume_list.patch -Patch21: lvm2-2_02_182-cache-drop-metadata_format-validation.patch -Patch22: lvm2-2_02_182-mirror-fix-splitmirrors-for-mirror-type.patch -Patch23: lvm2-2_02_182-lvconvert-fix-direct-raid0-to-striped-conversion.patch -Patch24: lvm2-2_02_182-lvconvert-fix-conversion-attempts-to-linear.patch -Patch25: lvm2-2_02_182-dmeventd-lvm2-plugin-uses-envvar-registry.patch -Patch26: lvm2-2_02_182-scripts-add-After-rbdmap.service-to-lvm2-activation.patch -Patch27: lvm2-2_02_182-lvconvert-avoid-superfluous-interim-raid-type.patch -Patch28: lvm2-2_02_182-lvconvert-fix-interim-segtype-regression-on-raid6-co.patch -Patch29: lvm2-2_02_182-fix-clustered-mirror-repair.patch -Patch30: lvm2-2_02_182-metadata-prevent-writing-beyond-metadata-area.patch -# BZ 1647718: -Patch31: lvm2-2_02_183-libdm-stats-move-no-regions-warning-after-dm_stats_l.patch -Patch32: lvm2-2_02_183-dmsetup-fix-stats-report-command-output.patch -# BZ 1656498: -Patch33: lvm2-2_02_183-io-use-sync-io-if-aio-fails.patch -Patch34: lvm2-2_02_183-bcache-sync-io-fixes.patch -Patch35: lvm2-2_02_183-WHATS_NEW-sync-io.patch -# BZ 1657640: -Patch36: lvm2-2_02_182-scan-use-full-md-filter-when-md-1.0-devices-are-pres.patch -Patch37: lvm2-2_02_182-scan-enable-full-md-filter-when-md-1.0-devices-are-p.patch -Patch38: lvm2-2_02_183-scan-md-metadata-version-0.90-is-at-the-end-of-disk.patch -Patch39: lvm2-2_02_183-pvscan-lvmetad-use-full-md-filter-when-md-1.0-device.patch -Patch40: lvm2-2_02_183-pvscan-lvmetad-use-udev-info-to-improve-md-component.patch -# Overhead: -Patch41: lvm2-2_02_183-build-make-generate.patch -Patch42: lvm2-2_02_183-WHATS_NEW.patch -# BZ 1688316: -Patch43: lvm2-2_02_184-apply-obtain_device_list_from_udev-to-all-libudev-us.patch -# BZ 1695879 -Patch44: lvm2-2_02_182-bcache-reduce-MAX_IO-to-256.patch -# Mem leak by covertity: -Patch45: lvm2-2_02_185-bcache-Fix-memory-leak.patch -# BZ 1696742 -Patch46: lvm2-2_02_184-config-add-new-setting-io_memory_size.patch -Patch47: lvm2-2_02_184-io-warn-when-metadata-size-approaches-io-memory-size.patch -Patch48: lvm2-2_02_184-io-increase-the-default-io-memory-from-4-to-8-MiB.patch -# BZ 1696740 -Patch49: lvm2-2_02_184-dm-migration_threshold-for-old-linked-tools.patch -# Internals: -Patch50: lvm2-rhel-config-Change-version-for-backported-config-options.patch -Patch51: lvm2-build-make-generate.patch -# BZ 1698750 -Patch52: lvm2-2_02_184-pvscan-lvmetad-init-should-set-updating-before-scann.patch - +Patch7: lvm2-2_02_186-lvmlockd-do-not-allow-mirror-LV-to-be-activated-shar.patch +Patch8: lvm2-2_02_186-man-updates-to-lvmlockd.patch +Patch9: lvm2-2_02_186-cache-support-no_discard_passdown.patch +Patch10: lvm2-2_02_186-mirror-fix-monitoring-change.patch +Patch11: lvm2-make-generate.patch BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel BuildRequires: libblkid-devel >= %{util_linux_version} @@ -195,54 +142,13 @@ or more physical volumes and creating one or more logical volumes %patch2 -p1 -b .libdm_symbol_versioning %patch3 -p1 -b .blkid_sublks_badcsum %patch4 -p1 -b .default_allow_dup -%patch5 -p1 -b .startlimitinterval +#%%patch5 -p1 -b .startlimitinterval %patch6 -p1 -b .add_lvm1_and_pool -%patch7 -p1 -b .make_generate -%patch8 -p1 -b .post_release -%patch9 -p1 -b .lvconvert_matching_no_option -%patch10 -p1 -b .lvconvert_text_splitmirrors -%patch11 -p1 -b .reject_conversions_under_snapshot -%patch12 -p1 -b .dmsetup_fix_error_display_info_cols -%patch13 -p1 -b .reject_conversions_trackchage_LVs -%patch14 -p1 -b .reject_conversions_trackchang_subLVs -%patch15 -p1 -b .dmeventd_base_vdo_plugin -%patch16 -p1 -b .dmeventd_rebase_to_stable_branch -%patch17 -p1 -b .WHATS_NEW -%patch18 -p1 -b .build_make_generate -%patch19 -p1 -b .close_excl_fd_after_pvcreate -%patch20 -p1 -b .mirrors_fix_RO_volume_list -%patch21 -p1 -b .cache_drop_metadata_format_validation -%patch22 -p1 -b .mirror_fix_splitmirrors -%patch23 -p1 -b .direct_raid0_to_striped_conversion -%patch24 -p1 -b .fix_conversion_to_linear -%patch25 -p1 -b .dmeventd_lvm2_plugin_uses_envvar_registry -%patch26 -p1 -b .lvm2_activation_after_rdbmap -%patch27 -p1 -b .avoid_superfluous_raid_conversion -%patch28 -p1 -b .fix_interim_segtype_on_raid6 -%patch29 -p1 -b .fix_clvmd_mirror -%patch30 -p1 -b .prevent_writing_beyond_MDA -%patch31 -p1 -b .libdm_stats_move_no_regions_warning_after_dm_stats_l -%patch32 -p1 -b .dmsetup_fix_stats_report_command_output -%patch33 -p1 -b .io_use_sync_io_if_aio_fails -%patch34 -p1 -b .bcache_sync_io_fixes -%patch35 -p1 -b .WHATS_NEW_sync_io -%patch36 -p1 -b .scan_use_full_md_filter_when_md_1_0_devices_are_pres -%patch37 -p1 -b .scan_enable_full_md_filter_when_md_1_0_devices_are_p -%patch38 -p1 -b .scan_md_metadata_version_0_90_is_at_the_end_of_disk -%patch39 -p1 -b .pvscan_lvmetad_use_full_md_filter_when_md_1_0_device -%patch40 -p1 -b .pvscan_lvmetad_use_udev_info_to_improve_md_component -%patch41 -p1 -b .build_make_generate2 -%patch42 -p1 -b .WHATS_NEW2 -%patch43 -p1 -b .apply_obtain_device_list_from_udev -%patch44 -p1 -b .bcache_reduce_MAX_IO_to_256 -%patch45 -p1 -b .bcache_Fix_memory_leak -%patch46 -p1 -b .config_add_new_setting_io_memory_size -%patch47 -p1 -b .io_warn_when_metadata_size_approaches_io_memory_size -%patch48 -p1 -b .io_increase_the_default_io_memory_from_4_to_8_MiB -%patch49 -p1 -b .dm_migration_threshold_for_old_linked_tools -%patch50 -p1 -b .rhel_config -%patch51 -p1 -b .build_make_generate3 -%patch52 -p1 -b .pvscan_lvmetad_init_set_updating_before_scan +%patch7 -p1 -b .lvmlockd_do_not_allow_mirror_LV_activation +%patch8 -p1 -b .man_updates_to_lvmlockd +%patch9 -p1 -b .cache_support_no_discard_passdown +%patch10 -p1 -b .mirror_fix_monitoring_change +%patch11 -p1 -b .generate %build %global _default_pid_dir /run @@ -514,7 +420,7 @@ systemctl start lvm2-lvmpolld.socket %{_mandir}/man8/lvm-lvpoll.8.gz %endif %attr(755, -, -) %dir %{_sysconfdir}/lvm -%ghost %attr(600, -, -) %{_sysconfdir}/lvm/cache/.cache +%ghost %{_sysconfdir}/lvm/cache/.cache %attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvm.conf %attr(644, -, -) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/lvm/lvmlocal.conf %attr(755, -, -) %dir %{_sysconfdir}/lvm/profile @@ -990,7 +896,7 @@ the device-mapper event library. %package -n %{boom_pkgname} Summary: %{boom_summary} Version: %{boom_version} -Release: %{boom_release}%{?dist}.8%{?scratch} +Release: %{boom_release}%{?dist}%{?scratch} License: GPLv2 Group: System Environment/Base BuildArch: noarch @@ -1021,17 +927,30 @@ This package provides the python2 version of boom. %endif %changelog -* Mon May 13 2019 Marian Csontos - 7:2.02.180-10.el7_6.8 -- Set updating before scanning in lvmetad to avoid overwriting list of already - seen devices. - -* Tue Apr 09 2019 Marian Csontos - 7:2.02.180-10.el7_6.7 -- Add io_memory_size configuration option. -- Warn when metadata aproaches io_memory_size. -- Ensure migration_threshold for cache is at least 8 chunks. - -* Thu Apr 04 2019 Marian Csontos - 7:2.02.180-10.el7_6.6 -- Reduce max concurrent aios to avoid EMFILE with many devices. +* Fri Jun 21 2019 Marian Csontos - 7:2.02.185-2 +- Fix cluster conversions from linear to mirror. +- Report no_discard_passdown for cache LVs with lvs -o+kernel_discards. +- Prevent shared active mirror LVs with lvmlockd. +- Parsing of cache status understand no_discard_passdown. + +* Mon May 13 2019 Marian Csontos - 7:2.02.185-1 +- Fix change of monitoring in clustered volumes. +- Improve -lXXX%VG modifier which improves cache segment estimation. +- Add synchronization with udev before removing cached devices. +- Fix missing growth of _pmspare volume when extending _tmeta volume. +- Automatically grow thin metadata, when thin data gets too big. + +* Mon Apr 29 2019 Marian Csontos - 7:2.02.184-3 +- Fix shutdown of deamons. + +* Wed Apr 17 2019 Marian Csontos - 7:2.02.184-2 +- Add support for vgsplit with cached devices. +- Fix conversion of cache pool to RAID1 (2.02.184). +- Fix signal delivery checking race in libdaemon (lvmetad). +- Add missing Before=shutdown.target to LVM2 services to fix shutdown ordering. + +* Fri Mar 22 2019 Marian Csontos - 7:2.02.184-1 +- See WHATS_NEW and WHATS_NEW_DM in the documentation directory for details. * Mon Mar 18 2019 Marian Csontos - 7:2.02.180-10.el7_6.5 - boom: Bump release.