diff --git a/.gitignore b/.gitignore index f69a918..cda0b19 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,2 @@ -SOURCES/LVM2.2.02.186.tgz +SOURCES/LVM2.2.02.187.tgz SOURCES/boom-0.9.tar.gz diff --git a/.lvm2.metadata b/.lvm2.metadata index e9512fd..bcae77f 100644 --- a/.lvm2.metadata +++ b/.lvm2.metadata @@ -1,2 +1,2 @@ -7a3834ca1ddaa7c4edc3863f18ec604f45722c65 SOURCES/LVM2.2.02.186.tgz +2a846b1a766aad5e04e2835a510c84ecc7ceb28d SOURCES/LVM2.2.02.187.tgz dd96613e238f342641b5be8977ee8598662e8ab9 SOURCES/boom-0.9.tar.gz diff --git a/SOURCES/lvm2-2_02_187-WHATS_NEW-vgcreate-vgextend-logical-block-size.patch b/SOURCES/lvm2-2_02_187-WHATS_NEW-vgcreate-vgextend-logical-block-size.patch deleted file mode 100644 index 586bfbe..0000000 --- a/SOURCES/lvm2-2_02_187-WHATS_NEW-vgcreate-vgextend-logical-block-size.patch +++ /dev/null @@ -1,33 +0,0 @@ -From c5515908de62c3c68e12effad1aed7adc9e235f6 Mon Sep 17 00:00:00 2001 -From: David Teigland -Date: Thu, 1 Aug 2019 10:15:27 -0500 -Subject: [PATCH 3/6] WHATS_NEW: vgcreate/vgextend logical block size - -(cherry picked from commit 3a0d493d918510d863ddbdbc63d8a8ccb6ca2dd9) - -Conflicts: - WHATS_NEW - -(cherry picked from commit 9fcda0d9752bf06b619d29aa6738b4ac52acedfc) - -Conflicts: - WHATS_NEW ---- - WHATS_NEW | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/WHATS_NEW b/WHATS_NEW -index cf2ec3e..d99f183 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,3 +1,7 @@ -+Version 2.02.187 - -+=================================== -+ Prevent creating VGs with PVs with different logical block sizes. -+ - Version 2.02.186 - 27th August 2019 - =================================== - Improve internal removal of cached devices. --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_187-cov-Fix-memory-leak.patch b/SOURCES/lvm2-2_02_187-cov-Fix-memory-leak.patch deleted file mode 100644 index 243bc2d..0000000 --- a/SOURCES/lvm2-2_02_187-cov-Fix-memory-leak.patch +++ /dev/null @@ -1,26 +0,0 @@ -From a76bab1d408d75acc95a6ea8faaaaa298008b63e Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Wed, 28 Aug 2019 10:45:04 +0200 -Subject: [PATCH 1/6] cov: Fix memory leak - ---- - libdm/libdm-common.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/libdm/libdm-common.c b/libdm/libdm-common.c -index c300223..b06e678 100644 ---- a/libdm/libdm-common.c -+++ b/libdm/libdm-common.c -@@ -2012,7 +2012,8 @@ static int _sysfs_get_kernel_name(uint32_t major, uint32_t minor, char *buf, siz - log_sys_error("readlink", sysfs_path); - else { - log_sys_debug("readlink", sysfs_path); -- return _sysfs_find_kernel_name(major, minor, buf, buf_size); -+ r = _sysfs_find_kernel_name(major, minor, buf, buf_size); -+ goto bad; - } - goto bad; - } --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_187-lvconvert-improve-validation-thin-and-cache-pool-con.patch b/SOURCES/lvm2-2_02_187-lvconvert-improve-validation-thin-and-cache-pool-con.patch deleted file mode 100644 index 2ba05aa..0000000 --- a/SOURCES/lvm2-2_02_187-lvconvert-improve-validation-thin-and-cache-pool-con.patch +++ /dev/null @@ -1,109 +0,0 @@ -From 0cef052646dc4a1338a3febf38c3085cfa636cca Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Fri, 6 Sep 2019 18:09:40 +0200 -Subject: [PATCH 5/6] lvconvert: improve validation thin and cache pool - conversion - -Limit convertible LVs to thin-pool and cache-pools. -Also fix return code on interal error path to return ECMD_FAILED. - -(cherry picked from commit e147786bac52fea240955329963c9eed0eebfb18) - -Conflicts: - WHATS_NEW ---- - WHATS_NEW | 1 + - tools/lvconvert.c | 52 +++++++++++++++++++++++++++++++++++++++++++++++----- - 2 files changed, 48 insertions(+), 5 deletions(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index 399864d..d1f4530 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -2,6 +2,7 @@ Version 2.02.187 - - =================================== - Prevent creating VGs with PVs with different logical block sizes. - Pvmove runs in exlusively activating mode for exclusively active LVs. -+ Enhance validation for thin and cache pool conversion and swapping. - - Version 2.02.186 - 27th August 2019 - =================================== -diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index e66f063..799e746 100644 ---- a/tools/lvconvert.c -+++ b/tools/lvconvert.c -@@ -4309,24 +4309,66 @@ static int _lvconvert_to_pool_or_swap_metadata_single(struct cmd_context *cmd, - struct dm_list *use_pvh = NULL; - int to_thinpool = 0; - int to_cachepool = 0; -+ int lvt_enum = get_lvt_enum(lv); -+ struct lv_type *lvtype; - - switch (cmd->command->command_enum) { - case lvconvert_to_thinpool_or_swap_metadata_CMD: -+ if (lv_is_cache(lv)) -+ /* For cached LV check the cache origin LV type */ -+ lvt_enum = get_lvt_enum(seg_lv(first_seg(lv), 0)); - to_thinpool = 1; - break; - case lvconvert_to_cachepool_or_swap_metadata_CMD: -+ if (lv_is_cache(lv)) -+ goto_bad; /* Cache over cache is not supported */ - to_cachepool = 1; - break; - default: -- log_error(INTERNAL_ERROR "Invalid lvconvert pool command"); -- return 0; -- }; -+ log_error(INTERNAL_ERROR "Invalid lvconvert pool command."); -+ return ECMD_FAILED; -+ } -+ -+ switch (lvt_enum) { -+ case thinpool_LVT: -+ if (!to_thinpool) -+ goto_bad; /* can't accept cache-pool */ -+ break; /* swap thin-pool */ -+ case cachepool_LVT: -+ if (!to_cachepool) -+ goto_bad; /* can't accept thin-pool */ -+ break; /* swap cache-pool */ -+ case linear_LVT: -+ case raid_LVT: -+ case striped_LVT: -+ case zero_LVT: -+ break; -+ default: -+bad: -+ lvtype = get_lv_type(lvt_enum); -+ log_error("LV %s with type %s cannot be used as a %s pool LV.", -+ display_lvname(lv), lvtype ? lvtype->name : "unknown", -+ to_thinpool ? "thin" : "cache"); -+ return ECMD_FAILED; -+ } - - if (lv_is_origin(lv)) { - log_error("Cannot convert logical volume %s under snapshot.", - display_lvname(lv)); -- return 0; -- }; -+ return ECMD_FAILED; -+ } -+ -+ if (!lv_is_visible(lv)) { -+ log_error("Can't convert internal LV %s.", -+ display_lvname(lv)); -+ return ECMD_FAILED; -+ } -+ -+ if (lv_is_locked(lv)) { -+ log_error("Can't convert locked LV %s.", -+ display_lvname(lv)); -+ return ECMD_FAILED; -+ } - - if (cmd->position_argc > 1) { - /* First pos arg is required LV, remaining are optional PVs. */ --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_187-pvmove-check-if-participating-LV-is-already-exlcusiv.patch b/SOURCES/lvm2-2_02_187-pvmove-check-if-participating-LV-is-already-exlcusiv.patch deleted file mode 100644 index 2bd795d..0000000 --- a/SOURCES/lvm2-2_02_187-pvmove-check-if-participating-LV-is-already-exlcusiv.patch +++ /dev/null @@ -1,52 +0,0 @@ -From 36265f58ae0def19b2bbe55443d77a10bad8eeca Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Wed, 18 Sep 2019 12:42:50 +0200 -Subject: [PATCH 4/6] pvmove: check if participating LV is already exlcusively - active - -When running pvmove, we need to decide whether pvmove has to be doing -exlusive or non-exclusive activations for LV. - -Whenever LV that requires exlusive activation is present, it makes -pvmove exlusive. But when there is already activate i.e. linear LV -in exclusive mode it also needs to switch pvmove into 'exlusively -activating' pvmove. - -(cherry picked from commit 1349b61bb72d3a42636053ede0d6fa71cd4f2d93) - -Conflicts: - WHATS_NEW ---- - WHATS_NEW | 1 + - tools/pvmove.c | 3 ++- - 2 files changed, 3 insertions(+), 1 deletion(-) - -diff --git a/WHATS_NEW b/WHATS_NEW -index d99f183..399864d 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -1,6 +1,7 @@ - Version 2.02.187 - - =================================== - Prevent creating VGs with PVs with different logical block sizes. -+ Pvmove runs in exlusively activating mode for exclusively active LVs. - - Version 2.02.186 - 27th August 2019 - =================================== -diff --git a/tools/pvmove.c b/tools/pvmove.c -index 754bd58..3a447c4 100644 ---- a/tools/pvmove.c -+++ b/tools/pvmove.c -@@ -674,7 +674,8 @@ static int _pvmove_setup_single(struct cmd_context *cmd, - dm_list_iterate_items(lvl, lvs_changed) { - lvh = lv_lock_holder(lvl->lv); - /* Exclusive LV decides whether pvmove must be also exclusive */ -- if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh))) -+ if (lv_is_origin(lvh) || seg_only_exclusive(first_seg(lvh)) || -+ lv_is_active_exclusive(lvh)) - exclusive = 1; - } - --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_187-thin-activate-layer-pool-aas-read-only-LV.patch b/SOURCES/lvm2-2_02_187-thin-activate-layer-pool-aas-read-only-LV.patch deleted file mode 100644 index 41c70e3..0000000 --- a/SOURCES/lvm2-2_02_187-thin-activate-layer-pool-aas-read-only-LV.patch +++ /dev/null @@ -1,55 +0,0 @@ -From c1a6e218334ac561a695fa4cefd69208ba93107e Mon Sep 17 00:00:00 2001 -From: Zdenek Kabelac -Date: Sat, 14 Sep 2019 01:08:14 +0200 -Subject: [PATCH 6/6] thin: activate layer pool aas read-only LV - -When lvm2 is activating layered pool LV (to basically keep pool opened, -the other function used to be 'locking' be in sync with DM table) -use this LV in read-only mode - this prevents 'write' access into -data volume content of thin-pool. - -Note: since EMPTY/unused thin-pool is created as 'public LV' for generic -use by any user who i.e. wish to maintain thin-pool and thins himself. -At this moment, thin-pool appears as writable LV. As soon as the 1st. -thinLV is created, layer volume will appear is 'read-only' LV from this moment. - -(cherry picked from commit 2e51535b18f3a05428f087f3916ebce5c08d58d1) - -Conflicts: - WHATS_NEW ---- - WHATS_NEW | 1 + - lib/activate/dev_manager.c | 5 +++++ - 2 files changed, 6 insertions(+) - -diff --git a/WHATS_NEW b/WHATS_NEW -index d1f4530..00b84f9 100644 ---- a/WHATS_NEW -+++ b/WHATS_NEW -@@ -2,6 +2,7 @@ Version 2.02.187 - - =================================== - Prevent creating VGs with PVs with different logical block sizes. - Pvmove runs in exlusively activating mode for exclusively active LVs. -+ Activate thin-pool layered volume as 'read-only' device. - Enhance validation for thin and cache pool conversion and swapping. - - Version 2.02.186 - 27th August 2019 -diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c -index dc64159..56608e3 100644 ---- a/lib/activate/dev_manager.c -+++ b/lib/activate/dev_manager.c -@@ -84,6 +84,11 @@ int read_only_lv(const struct logical_volume *lv, const struct lv_activate_opts - if (lv_is_raid_image(lv) || lv_is_raid_metadata(lv)) - return 0; /* Keep RAID SubLvs writable */ - -+ if (!layer) { -+ if (lv_is_thin_pool(lv)) -+ return 1; -+ } -+ - return (laopts->read_only || !(lv->status & LVM_WRITE)); - } - --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_187-vgcreate-vgextend-restrict-PVs-with-mixed-block-size.patch b/SOURCES/lvm2-2_02_187-vgcreate-vgextend-restrict-PVs-with-mixed-block-size.patch deleted file mode 100644 index 7a1f31f..0000000 --- a/SOURCES/lvm2-2_02_187-vgcreate-vgextend-restrict-PVs-with-mixed-block-size.patch +++ /dev/null @@ -1,231 +0,0 @@ -From f450ffed18936a3b9a6249ad46b24741f7e7b2a3 Mon Sep 17 00:00:00 2001 -From: David Teigland -Date: Thu, 1 Aug 2019 10:06:47 -0500 -Subject: [PATCH 2/6] vgcreate/vgextend: restrict PVs with mixed block sizes - -Avoid having PVs with different logical block sizes in the same VG. -This prevents LVs from having mixed block sizes, which can produce -file system errors. - -The new config setting devices/allow_mixed_block_sizes (default 0) -can be changed to 1 to return to the unrestricted mode. - -(cherry picked from commit 0404539edb25e4a9d3456bb3e6b402aa2767af6b) - -Conflicts: - tools/lvmcmdline.c - tools/toollib.c - -(cherry picked from commit a57b92dec396ac79c57e02e54c04e205aa85f084) ---- - lib/commands/toolcontext.h | 1 + - lib/config/config_settings.h | 5 +++++ - lib/metadata/metadata-exported.h | 1 + - lib/metadata/metadata.c | 44 +++++++++++++++++++++++++++++++++++++ - tools/lvmcmdline.c | 2 ++ - tools/toollib.c | 47 ++++++++++++++++++++++++++++++++++++++++ - tools/vgcreate.c | 2 ++ - 7 files changed, 102 insertions(+) - -diff --git a/lib/commands/toolcontext.h b/lib/commands/toolcontext.h -index 4b2a079..497f4bd 100644 ---- a/lib/commands/toolcontext.h -+++ b/lib/commands/toolcontext.h -@@ -155,6 +155,7 @@ struct cmd_context { - unsigned include_shared_vgs:1; /* report/display cmds can reveal lockd VGs */ - unsigned include_active_foreign_vgs:1; /* cmd should process foreign VGs with active LVs */ - unsigned vg_read_print_access_error:1; /* print access errors from vg_read */ -+ unsigned allow_mixed_block_sizes:1; - unsigned force_access_clustered:1; - unsigned lockd_gl_disable:1; - unsigned lockd_vg_disable:1; -diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h -index 9904a62..622e982 100644 ---- a/lib/config/config_settings.h -+++ b/lib/config/config_settings.h -@@ -470,6 +470,11 @@ cfg(devices_allow_changes_with_duplicate_pvs_CFG, "allow_changes_with_duplicate_ - "Enabling this setting allows the VG to be used as usual even with\n" - "uncertain devices.\n") - -+cfg(devices_allow_mixed_block_sizes_CFG, "allow_mixed_block_sizes", devices_CFG_SECTION, 0, CFG_TYPE_BOOL, 0, vsn(2, 3, 6), NULL, 0, NULL, -+ "Allow PVs in the same VG with different logical block sizes.\n" -+ "When allowed, the user is responsible to ensure that an LV is\n" -+ "using PVs with matching block sizes when necessary.\n") -+ - cfg_array(allocation_cling_tag_list_CFG, "cling_tag_list", allocation_CFG_SECTION, CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 77), NULL, 0, NULL, - "Advise LVM which PVs to use when searching for new space.\n" - "When searching for free space to extend an LV, the 'cling' allocation\n" -diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h -index 2245c29..5674545 100644 ---- a/lib/metadata/metadata-exported.h -+++ b/lib/metadata/metadata-exported.h -@@ -593,6 +593,7 @@ struct pvcreate_params { - unsigned is_remove : 1; /* is removing PVs, not creating */ - unsigned preserve_existing : 1; - unsigned check_failed : 1; -+ unsigned check_consistent_block_size : 1; - }; - - struct lvresize_params { -diff --git a/lib/metadata/metadata.c b/lib/metadata/metadata.c -index 3620240..123f7f5 100644 ---- a/lib/metadata/metadata.c -+++ b/lib/metadata/metadata.c -@@ -699,12 +699,40 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp) - { - struct pv_list *pvl; - unsigned int max_phys_block_size = 0; -+ unsigned int physical_block_size, logical_block_size; -+ unsigned int prev_lbs = 0; -+ int inconsistent_existing_lbs = 0; - - log_debug_metadata("Adding PVs to VG %s.", vg->name); - - if (vg_bad_status_bits(vg, RESIZEABLE_VG)) - return_0; - -+ /* -+ * Check if existing PVs have inconsistent block sizes. -+ * If so, do not enforce new devices to be consistent. -+ */ -+ dm_list_iterate_items(pvl, &vg->pvs) { -+ logical_block_size = 0; -+ physical_block_size = 0; -+ -+ if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size)) -+ continue; -+ -+ if (!logical_block_size) -+ continue; -+ -+ if (!prev_lbs) { -+ prev_lbs = logical_block_size; -+ continue; -+ } -+ -+ if (prev_lbs != logical_block_size) { -+ inconsistent_existing_lbs = 1; -+ break; -+ } -+ } -+ - dm_list_iterate_items(pvl, &pp->pvs) { - log_debug_metadata("Adding PV %s to VG %s.", pv_dev_name(pvl->pv), vg->name); - -@@ -715,6 +743,22 @@ int vg_extend_each_pv(struct volume_group *vg, struct pvcreate_params *pp) - return 0; - } - -+ logical_block_size = 0; -+ physical_block_size = 0; -+ -+ if (!dev_get_direct_block_sizes(pvl->pv->dev, &physical_block_size, &logical_block_size)) -+ log_warn("WARNING: PV %s has unknown block size.", pv_dev_name(pvl->pv)); -+ -+ else if (prev_lbs && logical_block_size && (logical_block_size != prev_lbs)) { -+ if (vg->cmd->allow_mixed_block_sizes || inconsistent_existing_lbs) -+ log_debug("Devices have inconsistent block sizes (%u and %u)", prev_lbs, logical_block_size); -+ else { -+ log_error("Devices have inconsistent logical block sizes (%u and %u).", -+ prev_lbs, logical_block_size); -+ return 0; -+ } -+ } -+ - if (!add_pv_to_vg(vg, pv_dev_name(pvl->pv), pvl->pv, 0)) { - log_error("PV %s cannot be added to VG %s.", - pv_dev_name(pvl->pv), vg->name); -diff --git a/tools/lvmcmdline.c b/tools/lvmcmdline.c -index f238b64..f82827d 100644 ---- a/tools/lvmcmdline.c -+++ b/tools/lvmcmdline.c -@@ -2308,6 +2308,8 @@ static int _get_current_settings(struct cmd_context *cmd) - if (cmd->cname->flags & CAN_USE_ONE_SCAN) - cmd->can_use_one_scan = 1; - -+ cmd->allow_mixed_block_sizes = find_config_tree_bool(cmd, devices_allow_mixed_block_sizes_CFG, NULL); -+ - cmd->partial_activation = 0; - cmd->degraded_activation = 0; - activation_mode = find_config_tree_str(cmd, activation_mode_CFG, NULL); -diff --git a/tools/toollib.c b/tools/toollib.c -index 81953ee..0b957cc 100644 ---- a/tools/toollib.c -+++ b/tools/toollib.c -@@ -5506,6 +5506,8 @@ int pvcreate_each_device(struct cmd_context *cmd, - struct device_list *devl; - const char *pv_name; - int consistent = 0; -+ unsigned int physical_block_size, logical_block_size; -+ unsigned int prev_pbs = 0, prev_lbs = 0; - int must_use_all = (cmd->cname->flags & MUST_USE_ALL_ARGS); - int found; - unsigned i; -@@ -5584,6 +5586,51 @@ int pvcreate_each_device(struct cmd_context *cmd, - pd->dev = dev_cache_get(pd->name, cmd->full_filter); - - /* -+ * Check for consistent block sizes. -+ */ -+ if (pp->check_consistent_block_size) { -+ dm_list_iterate_items(pd, &pp->arg_devices) { -+ if (!pd->dev) -+ continue; -+ -+ logical_block_size = 0; -+ physical_block_size = 0; -+ -+ if (!dev_get_direct_block_sizes(pd->dev, &physical_block_size, &logical_block_size)) { -+ log_warn("WARNING: Unknown block size for device %s.", dev_name(pd->dev)); -+ continue; -+ } -+ -+ if (!logical_block_size) { -+ log_warn("WARNING: Unknown logical_block_size for device %s.", dev_name(pd->dev)); -+ continue; -+ } -+ -+ if (!prev_lbs) { -+ prev_lbs = logical_block_size; -+ prev_pbs = physical_block_size; -+ continue; -+ } -+ -+ if (prev_lbs == logical_block_size) { -+ /* Require lbs to match, just warn about unmatching pbs. */ -+ if (!cmd->allow_mixed_block_sizes && prev_pbs && physical_block_size && -+ (prev_pbs != physical_block_size)) -+ log_warn("WARNING: Devices have inconsistent physical block sizes (%u and %u).", -+ prev_pbs, physical_block_size); -+ continue; -+ } -+ -+ if (!cmd->allow_mixed_block_sizes) { -+ log_error("Devices have inconsistent logical block sizes (%u and %u).", -+ prev_lbs, logical_block_size); -+ log_print("See lvm.conf allow_mixed_block_sizes."); -+ return 0; -+ } -+ } -+ } -+ -+ /* - * Use process_each_pv to search all existing PVs and devices. - * - * This is a slightly different way to use process_each_pv, because the -diff --git a/tools/vgcreate.c b/tools/vgcreate.c -index 4356d99..7add53b 100644 ---- a/tools/vgcreate.c -+++ b/tools/vgcreate.c -@@ -48,6 +48,8 @@ int vgcreate(struct cmd_context *cmd, int argc, char **argv) - /* Don't create a new PV on top of an existing PV like pvcreate does. */ - pp.preserve_existing = 1; - -+ pp.check_consistent_block_size = 1; -+ - if (!vgcreate_params_set_defaults(cmd, &vp_def, NULL)) - return EINVALID_CMD_LINE; - vp_def.vg_name = vg_name; --- -1.8.3.1 - diff --git a/SOURCES/lvm2-2_02_188-blkdeactivate-add-support-for-VDO-in-blkdeactivate-script.patch b/SOURCES/lvm2-2_02_188-blkdeactivate-add-support-for-VDO-in-blkdeactivate-script.patch new file mode 100644 index 0000000..546ee2e --- /dev/null +++ b/SOURCES/lvm2-2_02_188-blkdeactivate-add-support-for-VDO-in-blkdeactivate-script.patch @@ -0,0 +1,196 @@ +From 9392907e12b32fdb84eb2d688036bfb9b0faf2e9 Mon Sep 17 00:00:00 2001 +From: Peter Rajnoha +Date: Thu, 9 Apr 2020 15:23:58 +0200 +Subject: [PATCH] blkdeactivate: add support for VDO in blkdeactivate script + +Make it possible to tear down VDO volumes with blkdeactivate if VDO is +part of a device stack (and if VDO binary is installed). Also, support +optional -o|--vdooptions configfile=file. + +(cherry picked from commit 0dd905c959a8f36ea627027336b6d5dafb015001) + +Conflicts: + WHATS_NEW_DM +--- + WHATS_NEW_DM | 4 ++++ + man/blkdeactivate.8_main | 11 +++++++++++ + scripts/blkdeactivate.sh.in | 48 ++++++++++++++++++++++++++++++++++++++++++++- + 3 files changed, 62 insertions(+), 1 deletion(-) + +diff --git a/WHATS_NEW_DM b/WHATS_NEW_DM +index 2b213bb..31e655c 100644 +--- a/WHATS_NEW_DM ++++ b/WHATS_NEW_DM +@@ -1,3 +1,7 @@ ++Version 1.02.172 - ++================================== ++ Add support for VDO in blkdeactivate script. ++ + Version 1.02.170 - 24th March 2020 + ================================== + Add support for DM_DEVICE_GET_TARGET_VERSION. +diff --git a/man/blkdeactivate.8_main b/man/blkdeactivate.8_main +index f3c19a8..06af52e 100644 +--- a/man/blkdeactivate.8_main ++++ b/man/blkdeactivate.8_main +@@ -9,6 +9,7 @@ blkdeactivate \(em utility to deactivate block devices + .RB [ -l \ \fIlvm_options\fP ] + .RB [ -m \ \fImpath_options\fP ] + .RB [ -r \ \fImdraid_options\fP ] ++.RB [ -o \ \fIvdo_options\fP ] + .RB [ -u ] + .RB [ -v ] + .RI [ device ] +@@ -70,6 +71,15 @@ Comma-separated list of MD RAID specific options: + Wait MD device's resync, recovery or reshape action to complete + before deactivation. + .RE ++ ++.TP ++.BR -o ", " --vdooptions \ \fIvdo_options\fP ++Comma-separated list of VDO specific options: ++.RS ++.IP \fIconfigfile=file\fP ++Use specified VDO configuration file. ++.RE ++ + .TP + .BR -u ", " --umount + Unmount a mounted device before trying to deactivate it. +@@ -120,4 +130,5 @@ of a device-mapper device fails, retry it and force removal. + .BR lvm (8), + .BR mdadm (8), + .BR multipathd (8), ++.BR vdo (8), + .BR umount (8) +diff --git a/scripts/blkdeactivate.sh.in b/scripts/blkdeactivate.sh.in +index a4b8a8f..57b3e58 100644 +--- a/scripts/blkdeactivate.sh.in ++++ b/scripts/blkdeactivate.sh.in +@@ -1,6 +1,6 @@ + #!/bin/bash + # +-# Copyright (C) 2012-2017 Red Hat, Inc. All rights reserved. ++# Copyright (C) 2012-2020 Red Hat, Inc. All rights reserved. + # + # This file is part of LVM2. + # +@@ -38,6 +38,7 @@ MDADM="/sbin/mdadm" + MOUNTPOINT="/bin/mountpoint" + MPATHD="/sbin/multipathd" + UMOUNT="/bin/umount" ++VDO="/bin/vdo" + + sbindir="@SBINDIR@" + DMSETUP="$sbindir/dmsetup" +@@ -54,6 +55,7 @@ DMSETUP_OPTS="" + LVM_OPTS="" + MDADM_OPTS="" + MPATHD_OPTS="" ++VDO_OPTS="" + + LSBLK="/bin/lsblk -r --noheadings -o TYPE,KNAME,NAME,MOUNTPOINT" + LSBLK_VARS="local devtype local kname local name local mnt" +@@ -124,6 +126,7 @@ usage() { + echo " -l | --lvmoptions LVM_OPTIONS Comma separated LVM specific options" + echo " -m | --mpathoptions MPATH_OPTIONS Comma separated DM-multipath specific options" + echo " -r | --mdraidoptions MDRAID_OPTIONS Comma separated MD RAID specific options" ++ echo " -o | --vdooptions VDO_OPTIONS Comma separated VDO specific options" + echo " -u | --umount Unmount the device if mounted" + echo " -v | --verbose Verbose mode (also implies -e)" + echo +@@ -138,6 +141,8 @@ usage() { + echo " wait wait for resync, recovery or reshape to complete first" + echo " MPATH_OPTIONS:" + echo " disablequeueing disable queueing on all DM-multipath devices first" ++ echo " VDO_OPTIONS:" ++ echo " configfile=file use specified VDO configuration file" + + exit + } +@@ -319,6 +324,23 @@ deactivate_md () { + fi + } + ++deactivate_vdo() { ++ local xname ++ xname=$(printf "%s" "$name") ++ test -b "$DEV_DIR/mapper/$xname" || return 0 ++ test -z "${SKIP_DEVICE_LIST["$kname"]}" || return 1 ++ ++ deactivate_holders "$DEV_DIR/mapper/$xname" || return 1 ++ ++ echo -n " [VDO]: deactivating VDO volume $xname... " ++ if eval "$VDO" stop $VDO_OPTS --name="$xname" "$OUT" "$ERR"; then ++ echo "done" ++ else ++ echo "skipping" ++ add_device_to_skip_list ++ fi ++} ++ + deactivate () { + ###################################################################### + # DEACTIVATION HOOKS FOR NEW DEVICE TYPES GO HERE! # +@@ -335,6 +357,8 @@ deactivate () { + ###################################################################### + if test "$devtype" = "lvm"; then + deactivate_lvm ++ elif test "$devtype" = "vdo"; then ++ deactivate_vdo + elif test "${kname:0:3}" = "dm-"; then + deactivate_dm + elif test "${kname:0:2}" = "md"; then +@@ -479,6 +503,20 @@ get_mpathopts() { + IFS=$ORIG_IFS + } + ++get_vdoopts() { ++ ORIG_IFS=$IFS; IFS=',' ++ ++ for opt in $1; do ++ case "$opt" in ++ "") ;; ++ configfile=*) tmp=${opt#*=}; VDO_OPTS+="--confFile=${tmp%%,*} " ;; ++ *) echo "$opt: unknown VDO option" ++ esac ++ done ++ ++ IFS=$ORIG_IFS ++} ++ + set_env() { + if test "$ERRORS" -eq "1"; then + unset ERR +@@ -493,6 +531,7 @@ set_env() { + LVM_OPTS+="-vvvv" + MDADM_OPTS+="-vv" + MPATHD_OPTS+="-v 3" ++ VDO_OPTS+="--verbose " + else + OUT="1>$DEV_DIR/null" + fi +@@ -509,6 +548,12 @@ set_env() { + MDADM_AVAILABLE=0 + fi + ++ if test -f $VDO; then ++ VDO_AVAILABLE=1 ++ else ++ VDO_AVAILABLE=0 ++ fi ++ + MPATHD_RUNNING=0 + test "$MPATHD_DO_DISABLEQUEUEING" -eq 1 && { + if test -f "$MPATHD"; then +@@ -528,6 +573,7 @@ while test $# -ne 0; do + "-l"|"--lvmoptions") get_lvmopts "$2" ; shift ;; + "-m"|"--mpathoptions") get_mpathopts "$2" ; shift ;; + "-r"|"--mdraidoptions") get_mdraidopts "$2"; shift ;; ++ "-o"|"--vdooptions") get_vdoopts "$2"; shift ;; + "-u"|"--umount") DO_UMOUNT=1 ;; + "-v"|"--verbose") VERBOSE=1 ; ERRORS=1 ;; + "-vv") VERBOSE=1 ; ERRORS=1 ; set -x ;; +-- +1.8.3.1 + diff --git a/SOURCES/lvm2-2_02_188-lvconvert-no-validation-for-thin-pools-not-used-by-lvm.patch b/SOURCES/lvm2-2_02_188-lvconvert-no-validation-for-thin-pools-not-used-by-lvm.patch new file mode 100644 index 0000000..d411dc0 --- /dev/null +++ b/SOURCES/lvm2-2_02_188-lvconvert-no-validation-for-thin-pools-not-used-by-lvm.patch @@ -0,0 +1,33 @@ +From ca84deb23f0cfb51dbeba0ffe44f757345e6f8a0 Mon Sep 17 00:00:00 2001 +From: Zdenek Kabelac +Date: Wed, 8 Apr 2020 11:46:42 +0200 +Subject: [PATCH] lvconvert: no validation for thin-pools not used by lvm2 + +lvm2 supports thin-pool to be later used by other tools doing +virtual volumes themself (i.e. docker) - in this case we +shall not validate transaction Id - is this is used by +other tools and lvm2 keeps value 0 - so the transationId +validation need to be skipped in this case. + +(cherry picked from commit 1316cafbe988307264e4f87dbcffaf56bc2ab388) +--- + tools/lvconvert.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/tools/lvconvert.c b/tools/lvconvert.c +index d0a6b02..38c8146 100644 +--- a/tools/lvconvert.c ++++ b/tools/lvconvert.c +@@ -2330,7 +2330,8 @@ static int _lvconvert_thin_pool_repair(struct cmd_context *cmd, + goto deactivate_mlv; + } + +- if (thin_dump[0]) { ++ /* Check matching transactionId when thin-pool is used by lvm2 (transactionId != 0) */ ++ if (first_seg(pool_lv)->transaction_id && thin_dump[0]) { + argv[0] = thin_dump; + argv[1] = pms_path; + argv[2] = NULL; +-- +1.8.3.1 + 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 d3207da..dcd4c8a 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 @@ -1,17 +1,10 @@ -From e8b1625c56aa1e2017cbcf8f7dfba30ac79396ce Mon Sep 17 00:00:00 2001 -From: Marian Csontos -Date: Wed, 29 Mar 2017 15:38:54 +0200 -Subject: [PATCH 4/7] - lvm2-drop-unavailable-libblkid-2_24-BLKID_SUBLKS_BADCSUM-for-signature-detection - ---- configure | 20 ++++++++++---------- configure.ac | 4 ++-- lib/device/dev-type.c | 3 +-- 3 files changed, 13 insertions(+), 14 deletions(-) diff --git a/configure b/configure -index 4d2fb2f..f357462 100755 +index fe0e8e2..ce37d03 100755 --- a/configure +++ b/configure @@ -12111,12 +12111,12 @@ if test -n "$BLKID_CFLAGS"; then diff --git a/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch b/SOURCES/lvm2-rhel7-add-lvm1-and-pool-back.patch index a16d52e..af41e37 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 f357462..2585e58 100755 +index ce37d03..f0ad5d1 100755 --- a/configure +++ b/configure @@ -675,6 +675,7 @@ PYTHON_BINDINGS @@ -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 9ae359b..3e379fe 100644 +index 76aa62c..ce85631 100644 --- a/daemons/lvmetad/lvmetad-core.c +++ b/daemons/lvmetad/lvmetad-core.c @@ -200,12 +200,12 @@ struct vg_info { @@ -539,7 +539,7 @@ index 1d42235..241cf09 100644 locking endif diff --git a/lib/activate/activate.c b/lib/activate/activate.c -index 561a965..0790817 100644 +index fb6f545..c395d58 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -37,6 +37,19 @@ @@ -563,7 +563,7 @@ index 561a965..0790817 100644 struct dm_list *modules) { diff --git a/lib/activate/activate.h b/lib/activate/activate.h -index 524d2bf..43d26d1 100644 +index 7139276..a938cb4 100644 --- a/lib/activate/activate.h +++ b/lib/activate/activate.h @@ -91,6 +91,7 @@ int activation(void); @@ -575,7 +575,7 @@ index 524d2bf..43d26d1 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 9890325..0bec548 100644 +index c12ec2b..b6a02b0 100644 --- a/lib/cache/lvmcache.c +++ b/lib/cache/lvmcache.c @@ -22,6 +22,8 @@ @@ -587,7 +587,7 @@ index 9890325..0bec548 100644 #include "config.h" #include "lvmetad.h" -@@ -545,6 +547,8 @@ void lvmcache_drop_metadata(const char *vgname, int drop_precommitted) +@@ -547,6 +549,8 @@ void lvmcache_drop_metadata(const char *vgname, int drop_precommitted) /* For VG_ORPHANS, we need to invalidate all labels on orphan PVs. */ if (!strcmp(vgname, VG_ORPHANS)) { _drop_metadata(FMT_TEXT_ORPHAN_VG_NAME, 0); @@ -597,7 +597,7 @@ index 9890325..0bec548 100644 _drop_metadata(vgname, drop_precommitted); } diff --git a/lib/cache/lvmetad.c b/lib/cache/lvmetad.c -index d7e798d..1eda567 100644 +index 61ba53e..7a85c0f 100644 --- a/lib/cache/lvmetad.c +++ b/lib/cache/lvmetad.c @@ -38,6 +38,8 @@ static const char *_lvmetad_socket = NULL; @@ -609,7 +609,7 @@ index d7e798d..1eda567 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) -@@ -2290,6 +2292,18 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev, +@@ -2324,6 +2326,18 @@ int lvmetad_pvscan_single(struct cmd_context *cmd, struct device *dev, if (!baton.fid) goto_bad; @@ -628,7 +628,7 @@ index d7e798d..1eda567 100644 lvmcache_foreach_mda(info, _lvmetad_pvscan_single, &baton); if (!baton.vg) -@@ -2454,9 +2468,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait) +@@ -2488,9 +2502,11 @@ int lvmetad_pvscan_all_devs(struct cmd_context *cmd, int do_wait, struct dm_list } /* @@ -642,7 +642,7 @@ index d7e798d..1eda567 100644 log_debug_lvmetad("Enabling lvmetad which was previously disabled."); lvmetad_clear_disabled(cmd); } -@@ -3104,6 +3120,9 @@ int lvmetad_is_disabled(struct cmd_context *cmd, const char **reason) +@@ -3138,6 +3154,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"; @@ -708,10 +708,10 @@ index 95fb343..3db9bb3 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 02e2b29..9904a62 100644 +index 114680c..87bd8ca 100644 --- a/lib/config/config_settings.h +++ b/lib/config/config_settings.h -@@ -780,14 +780,26 @@ cfg(global_activation_CFG, "activation", global_CFG_SECTION, 0, CFG_TYPE_BOOL, D +@@ -785,14 +785,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") @@ -5457,7 +5457,7 @@ index 0000000..5812adb + +#endif diff --git a/lib/format_text/export.c b/lib/format_text/export.c -index 7866d56..e535237 100644 +index 3e294a1..ee699a7 100644 --- a/lib/format_text/export.c +++ b/lib/format_text/export.c @@ -467,6 +467,8 @@ static int _print_vg(struct formatter *f, struct volume_group *vg) @@ -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 f39051c..4d0f6d5 100644 +index 026f93a..6f5d739 100644 --- a/lib/format_text/format-text.c +++ b/lib/format_text/format-text.c -@@ -2568,9 +2568,9 @@ struct format_type *create_text_format(struct cmd_context *cmd) +@@ -2565,9 +2565,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 76451ea..9af90f9 100644 +index c8acb6c..6db8575 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c -@@ -6011,6 +6011,8 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6013,6 +6013,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 76451ea..9af90f9 100644 int visible, historical; struct logical_volume *pool_lv = NULL; struct logical_volume *lock_lv = lv; -@@ -6163,6 +6165,10 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6165,6 +6167,10 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, } if (lv_is_cow(lv)) { @@ -5588,7 +5588,7 @@ index 76451ea..9af90f9 100644 log_verbose("Removing snapshot volume %s.", display_lvname(lv)); /* vg_remove_snapshot() will preload origin/former snapshots */ if (!vg_remove_snapshot(lv)) -@@ -6218,10 +6224,30 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, +@@ -6220,10 +6226,30 @@ int lv_remove_single(struct cmd_context *cmd, struct logical_volume *lv, } } @@ -5620,7 +5620,7 @@ index 76451ea..9af90f9 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 75caba1..2245c29 100644 +index 9c24132..5674545 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -149,7 +149,7 @@ @@ -5652,10 +5652,10 @@ index 75caba1..2245c29 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 cb38f66..3620240 100644 +index 666ad78..d448fd9 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) +@@ -1055,6 +1055,8 @@ struct volume_group *vg_create(struct cmd_context *cmd, const char *vg_name) vg->status = (RESIZEABLE_VG | LVM_READ | LVM_WRITE); vg->system_id = NULL; @@ -5664,7 +5664,7 @@ index cb38f66..3620240 100644 vg->extent_size = DEFAULT_EXTENT_SIZE * 2; vg->max_lv = DEFAULT_MAX_LV; -@@ -2969,7 +2971,7 @@ int vg_write(struct volume_group *vg) +@@ -3013,7 +3015,7 @@ int vg_write(struct volume_group *vg) return 0; } @@ -5673,7 +5673,7 @@ index cb38f66..3620240 100644 return_0; if (!vg_mda_used_count(vg)) { -@@ -5373,6 +5375,15 @@ int is_system_id_allowed(struct cmd_context *cmd, const char *system_id) +@@ -5419,6 +5421,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 cb38f66..3620240 100644 * A few commands allow read-only access to foreign VGs. */ if (cmd->include_foreign_vgs) -@@ -5424,6 +5435,11 @@ static int _vg_access_permitted(struct cmd_context *cmd, struct volume_group *vg +@@ -5470,6 +5481,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)) { @@ -5715,10 +5715,10 @@ index 9c05836..309a246 100644 #define SEG_CANNOT_BE_ZEROED (1ULL << 6) #define SEG_MONITORED (1ULL << 7) diff --git a/lib/metadata/snapshot_manip.c b/lib/metadata/snapshot_manip.c -index aeb739c..156b4c8 100644 +index 95a3b2b..63e3361 100644 --- a/lib/metadata/snapshot_manip.c +++ b/lib/metadata/snapshot_manip.c -@@ -337,6 +337,17 @@ int vg_remove_snapshot(struct logical_volume *cow) +@@ -325,6 +325,17 @@ int vg_remove_snapshot(struct logical_volume *cow) cow->snapshot = NULL; lv_set_visible(cow); @@ -5993,7 +5993,7 @@ index c2fbac6..abe193c 100644 arg(name_ARG, 'n', "name", string_VAL, 0, 0, "#lvcreate\n" diff --git a/tools/lvconvert.c b/tools/lvconvert.c -index 8a07a84..e66f063 100644 +index 677bed1..d0a6b02 100644 --- a/tools/lvconvert.c +++ b/tools/lvconvert.c @@ -1816,6 +1816,11 @@ static int _lvconvert_splitsnapshot(struct cmd_context *cmd, struct logical_volu @@ -6009,7 +6009,7 @@ index 8a07a84..e66f063 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 0840c65..f238b64 100644 +index 9c39f48..75a0401 100644 --- a/tools/lvmcmdline.c +++ b/tools/lvmcmdline.c @@ -19,9 +19,11 @@ @@ -6024,7 +6024,7 @@ index 0840c65..f238b64 100644 #include #include -@@ -2912,6 +2914,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) +@@ -2914,6 +2916,13 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) goto out; } @@ -6038,7 +6038,7 @@ index 0840c65..f238b64 100644 if (cmd->command->command_enum == lvconvert_repair_CMD) { log_warn("WARNING: Not using lvmetad because of repair."); lvmetad_make_unused(cmd); -@@ -2974,7 +2983,7 @@ int lvm_run_command(struct cmd_context *cmd, int argc, char **argv) +@@ -2976,7 +2985,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 @@ -6047,7 +6047,7 @@ index 0840c65..f238b64 100644 * In this case, disable the *use* of lvmetad by this command, reverting to * disk scanning. */ -@@ -3399,6 +3408,41 @@ static int _run_script(struct cmd_context *cmd, int argc, char **argv) +@@ -3401,6 +3410,41 @@ static int _run_script(struct cmd_context *cmd, int argc, char **argv) return ret; } @@ -6089,7 +6089,7 @@ index 0840c65..f238b64 100644 static void _nonroot_warning(void) { if (getuid() || geteuid()) -@@ -3488,6 +3532,19 @@ int lvm2_main(int argc, char **argv) +@@ -3490,6 +3534,19 @@ int lvm2_main(int argc, char **argv) } else run_name = dm_basename(argv[0]); @@ -6110,10 +6110,10 @@ index 0840c65..f238b64 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 c21845c..e5afe0c 100644 +index 2e7a864..9e76f52 100644 --- a/tools/pvscan.c +++ b/tools/pvscan.c -@@ -748,7 +748,7 @@ out: +@@ -801,7 +801,7 @@ out: * display the PV info. * * iii. If lvmetad is being used, but has been disabled (because of @@ -6122,7 +6122,7 @@ index c21845c..e5afe0c 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 -@@ -761,7 +761,8 @@ out: +@@ -814,7 +814,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 @@ -6145,7 +6145,7 @@ index 1d58387..f03e5d3 100644 } diff --git a/tools/toollib.c b/tools/toollib.c -index 1b01ccc..81953ee 100644 +index 0c1c095..a48eea0 100644 --- a/tools/toollib.c +++ b/tools/toollib.c @@ -14,6 +14,7 @@ @@ -6156,7 +6156,7 @@ index 1b01ccc..81953ee 100644 #include "format-text.h" #include -@@ -4168,6 +4169,7 @@ static int _process_duplicate_pvs(struct cmd_context *cmd, +@@ -4169,6 +4170,7 @@ static int _process_duplicate_pvs(struct cmd_context *cmd, .fid = &dummy_fid, .name = "", .system_id = (char *) "", @@ -6164,7 +6164,7 @@ index 1b01ccc..81953ee 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), -@@ -4805,6 +4807,23 @@ int pvcreate_params_from_args(struct cmd_context *cmd, struct pvcreate_params *p +@@ -4806,6 +4808,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); @@ -6188,7 +6188,7 @@ index 1b01ccc..81953ee 100644 if (arg_is_set(cmd, metadataignore_ARG)) pp->pva.metadataignore = arg_int_value(cmd, metadataignore_ARG, DEFAULT_PVMETADATAIGNORE); -@@ -5164,7 +5183,10 @@ static int _pvcreate_check_single(struct cmd_context *cmd, +@@ -5165,7 +5184,10 @@ static int _pvcreate_check_single(struct cmd_context *cmd, pd->is_orphan_pv = 1; } @@ -6200,7 +6200,7 @@ index 1b01ccc..81953ee 100644 } else { log_debug("Found pvcreate arg %s: device is not a PV.", pd->name); /* Device is not a PV. */ -@@ -5393,7 +5415,10 @@ static int _pvremove_check_single(struct cmd_context *cmd, +@@ -5394,7 +5416,10 @@ static int _pvremove_check_single(struct cmd_context *cmd, pd->is_orphan_pv = 1; } @@ -6345,7 +6345,7 @@ index ca9615c..8bdf8be 100644 &_vgconvert_single); } diff --git a/tools/vgscan.c b/tools/vgscan.c -index f9fa382..1ec9083 100644 +index a1ef264..7a63996 100644 --- a/tools/vgscan.c +++ b/tools/vgscan.c @@ -44,7 +44,7 @@ static int _vgscan_single(struct cmd_context *cmd, const char *vg_name, diff --git a/SOURCES/lvm2-rhel7.patch b/SOURCES/lvm2-rhel7.patch index b7df03d..0fd29af 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 7f0e456..0c3bfac 100644 +index 79026e7..24945b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ --2.02.186(2) (2019-08-27) -+2.02.186(2)-RHEL7 (2019-08-27) +-2.02.187(2) (2020-03-24) ++2.02.187(2)-RHEL7 (2020-03-24) diff --git a/VERSION_DM b/VERSION_DM -index 864ceb8..5093e13 100644 +index a8e0ff9..4ffb776 100644 --- a/VERSION_DM +++ b/VERSION_DM @@ -1 +1 @@ --1.02.164 (2019-08-27) -+1.02.164-RHEL7 (2019-08-27) +-1.02.170 (2020-03-24) ++1.02.170-RHEL7 (2020-03-24) diff --git a/SOURCES/lvm2-set-default-preferred_names.patch b/SOURCES/lvm2-set-default-preferred_names.patch index 205dd10..3f65953 100644 --- a/SOURCES/lvm2-set-default-preferred_names.patch +++ b/SOURCES/lvm2-set-default-preferred_names.patch @@ -16,7 +16,7 @@ index 38855e9..7ccf928 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 0e81252..02e2b29 100644 +index 429bff1..114680c 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 11056b7..af842ac 100644 --- a/SPECS/lvm2.spec +++ b/SPECS/lvm2.spec @@ -1,4 +1,4 @@ -%global device_mapper_version 1.02.164 +%global device_mapper_version 1.02.170 %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 20 +%global boom_release 27 %global boom_summary A set of libraries and tools for managing boot loader entries %global boom_dir boom-%{boom_version} @@ -66,7 +66,7 @@ Summary: Userland logical volume management tools Name: lvm2 Epoch: 7 -Version: 2.02.186 +Version: 2.02.187 Release: 2%{?dist}%{?scratch} License: GPLv2 Group: System Environment/Base @@ -81,16 +81,10 @@ Patch4: lvm2-default-allow-changes-with-duplicate-pvs.patch #Patch5: lvm2-rhel7-fix-StartLimitInterval.patch Patch6: lvm2-rhel7-add-lvm1-and-pool-back.patch Patch7: lvm2-make-generate.patch -Patch8: lvm2-2_02_187-cov-Fix-memory-leak.patch -# BZ 1669751: -Patch9: lvm2-2_02_187-vgcreate-vgextend-restrict-PVs-with-mixed-block-size.patch -Patch10: lvm2-2_02_187-WHATS_NEW-vgcreate-vgextend-logical-block-size.patch -# BZ 1622813: -Patch11: lvm2-2_02_187-pvmove-check-if-participating-LV-is-already-exlcusiv.patch -# BZ 1697823: -Patch12: lvm2-2_02_187-lvconvert-improve-validation-thin-and-cache-pool-con.patch -Patch13: lvm2-2_02_187-thin-activate-layer-pool-aas-read-only-LV.patch - +# BZ 1806798: +Patch8: lvm2-2_02_188-lvconvert-no-validation-for-thin-pools-not-used-by-lvm.patch +# BZ 1821970: +Patch9: lvm2-2_02_188-blkdeactivate-add-support-for-VDO-in-blkdeactivate-script.patch BuildRequires: libselinux-devel >= %{libselinux_version}, libsepol-devel BuildRequires: libblkid-devel >= %{util_linux_version} @@ -151,12 +145,8 @@ or more physical volumes and creating one or more logical volumes #%%patch5 -p1 -b .startlimitinterval %patch6 -p1 -b .add_lvm1_and_pool %patch7 -p1 -b .generate -%patch8 -p1 -b .cov_Fix_memory_leak -%patch9 -p1 -b .vgcreate_vgextend_restrict_PVs_with_mixed_block_size -%patch10 -p1 -b .WHATS_NEW_vgcreate_vgextend_logical_block_size -%patch11 -p1 -b .pvmove_check_if_participating_LV_is_already_exlcusiv -%patch12 -p1 -b .lvconvert_improve_validation_thin_and_cache_pool_con -%patch13 -p1 -b .thin_activate_layer_pool_aas_read_only_LV +%patch8 -p1 -b .lvconvert_no_validation_for_thin_pools_not_used_by_lvm +%patch9 -p1 -b .add_support_for_VDO_in_blkdeactivate_script %build %global _default_pid_dir /run @@ -203,7 +193,7 @@ or more physical volumes and creating one or more logical volumes %configure --with-default-dm-run-dir=%{_default_dm_run_dir} --with-default-run-dir=%{_default_run_dir} --with-default-pid-dir=%{_default_pid_dir} --with-default-locking-dir=%{_default_locking_dir} --with-usrlibdir=%{_libdir} --enable-lvm1_fallback --enable-fsadm --with-pool=internal --enable-write_install --with-user= --with-group= --with-device-uid=0 --with-device-gid=6 --with-device-mode=0660 --enable-pkgconfig --enable-applib --enable-cmdlib --enable-dmeventd --enable-blkid_wiping %{?configure_python} %{?configure_cluster} %{?configure_cmirror} %{?configure_udev} %{?configure_thin} %{?configure_lvmetad} %{?configure_cache} %{?configure_lvmpolld} %{?configure_lockd_dlm} %{?configure_lockd_sanlock} %{?configure_dmfilemapd} -make %{?_smp_mflags} +make %{?_smp_mflags} V=1 %if %{enable_boom} ( @@ -213,12 +203,12 @@ cd ../%{boom_dir} %endif %install -make install DESTDIR=$RPM_BUILD_ROOT -make install_system_dirs DESTDIR=$RPM_BUILD_ROOT -make install_initscripts DESTDIR=$RPM_BUILD_ROOT -make install_systemd_units DESTDIR=$RPM_BUILD_ROOT -make install_systemd_generators DESTDIR=$RPM_BUILD_ROOT -make install_tmpfiles_configuration DESTDIR=$RPM_BUILD_ROOT +make install DESTDIR=$RPM_BUILD_ROOT V=1 +make install_system_dirs DESTDIR=$RPM_BUILD_ROOT V=1 +make install_initscripts DESTDIR=$RPM_BUILD_ROOT V=1 +make install_systemd_units DESTDIR=$RPM_BUILD_ROOT V=1 +make install_systemd_generators DESTDIR=$RPM_BUILD_ROOT V=1 +make install_tmpfiles_configuration DESTDIR=$RPM_BUILD_ROOT V=1 %if %{enable_boom} ( @@ -935,6 +925,33 @@ This package provides the python2 version of boom. %endif %changelog +* Thu Apr 16 2020 Marian Csontos - 7:2.02.187-2 +- No validation for thin pools not used by lvm, +- Add support for VDO in blkdeactivate script. + +* Tue Mar 24 2020 Marian Csontos - 7:2.02.187-1 +- Bug fix release. +- See WHATS_NEW file for details. + +* Thu Mar 12 2020 Marian Csontos - 7:2.02.186-7.el7_8.1 +- Fix failing pvs with locking_type 4. + +* Mon Feb 10 2020 Marian Csontos - 7:2.02.186-7 +- More limited prohibition of raid reshapes. + +* Tue Jan 14 2020 Marian Csontos - 7:2.02.186-6 +- Fix bug where headers of incorrect device could be overwritten. + +* Tue Jan 14 2020 Marian Csontos - 7:2.02.186-5 +- Prevent reshape of stacked LVs. + +* Wed Nov 27 2019 Marian Csontos - 7:2.02.186-4 +- Fix dmeventd failing to resize thin pool stacked on top of raid LVs. + +* Fri Nov 08 2019 Marian Csontos - 7:2.02.186-3 +- Fix lvmetad shutdown and avoid lenghty timeouts when rebooting system. +- Change allow_mixed_block_sizes default to 1. + * Tue Sep 24 2019 Marian Csontos - 7:2.02.186-2 - Prevent creating VGs with PVs with different logical block sizes. - Pvmove runs in exlusively activating mode for exclusively active LVs.