diff --git a/WHATS_NEW b/WHATS_NEW index c6be9b481..42ea4f550 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.03.12 - =================================== + Check if lvcreate passes read_only_volume_list with tags and skips zeroing. Allocation prints better error when metadata cannot fit on a single PV. Pvmove can better resolve full thin-pool tree move. Limit pool metadata spare to 16GiB. diff --git a/lib/activate/activate.c b/lib/activate/activate.c index 7ed644113..de866fb6c 100644 --- a/lib/activate/activate.c +++ b/lib/activate/activate.c @@ -466,6 +466,11 @@ static int _passes_readonly_filter(struct cmd_context *cmd, return _lv_passes_volumes_filter(cmd, lv, cn, activation_read_only_volume_list_CFG); } +int lv_passes_readonly_filter(const struct logical_volume *lv) +{ + return _passes_readonly_filter(lv->vg->cmd, lv); +} + int library_version(char *version, size_t size) { if (!activation()) diff --git a/lib/activate/activate.h b/lib/activate/activate.h index 3f4d128be..53c8631b4 100644 --- a/lib/activate/activate.h +++ b/lib/activate/activate.h @@ -208,6 +208,8 @@ int lvs_in_vg_opened(const struct volume_group *vg); int lv_is_active(const struct logical_volume *lv); +int lv_passes_readonly_filter(const struct logical_volume *lv); + /* Check is any component LV is active */ const struct logical_volume *lv_component_is_active(const struct logical_volume *lv); const struct logical_volume *lv_holder_is_active(const struct logical_volume *lv); diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index d101fa582..29c95ff63 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -7987,6 +7987,12 @@ static int _should_wipe_lv(struct lvcreate_params *lp, first_seg(first_seg(lv)->pool_lv)->zero_new_blocks)) return 0; + if (warn && (lv_passes_readonly_filter(lv))) { + log_warn("WARNING: Read-only activated logical volume %s not zeroed.", + display_lvname(lv)); + return 0; + } + /* Cannot zero read-only volume */ if ((lv->status & LVM_WRITE) && (lp->zero || lp->wipe_signatures))