|
|
f351e7 |
From 99b646d87469b5ca0e93fad6b77f51a00fbbd2b7 Mon Sep 17 00:00:00 2001
|
|
|
f351e7 |
From: Marian Csontos <mcsontos@redhat.com>
|
|
|
f351e7 |
Date: Wed, 12 Aug 2020 18:47:15 +0200
|
|
|
f351e7 |
Subject: [PATCH] Revert "debug: missing stacktrace"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit d0faad0db38fe733cae42d7df136d7ed4f7bcba6.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "raid: no wiping when zeroing raid metadata device"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit 9b9bf8786fb423a4430cc676301edadf2310098d.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "lvconvert: more support for yes conversion"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit b7f3667ce20b731bbda9b1d61df49abbcd1bd20e.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "wipe_lv: always zero at least 4K"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit fe78cd4082cb9af10580180d61898fcef93dc624.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "tests: check pool metadata are zeroed"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit 3f32f9811e01c8953d201c7c9b563561ad856130.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "tests: failure of zeroing fails command"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit 094d6f80ddb6d8a1c64977dfaae4073827063fe3.
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "make: make generate"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit 88b92d4225b90db82047f3bac55d8059918e9c1b.
|
|
|
f351e7 |
|
|
|
f351e7 |
Conflicts:
|
|
|
f351e7 |
man/lvconvert.8_pregen
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "pool: zero metadata"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit bc39d5bec6fea787a8d8d16fa484084b7d2a7c29.
|
|
|
f351e7 |
|
|
|
f351e7 |
Conflicts:
|
|
|
f351e7 |
WHATS_NEW
|
|
|
f351e7 |
|
|
|
f351e7 |
Revert "wipe_lv: make error a fatal event"
|
|
|
f351e7 |
|
|
|
f351e7 |
This reverts commit edbc5a62b26806e5c4de59b5292609e955303576.
|
|
|
f351e7 |
|
|
|
f351e7 |
Conflicts:
|
|
|
f351e7 |
WHATS_NEW
|
|
|
f351e7 |
|
|
|
f351e7 |
build: make generate
|
|
|
f351e7 |
---
|
|
|
f351e7 |
WHATS_NEW | 2 -
|
|
|
f351e7 |
conf/example.conf.in | 6 +--
|
|
|
f351e7 |
lib/config/config_settings.h | 5 +--
|
|
|
f351e7 |
lib/config/defaults.h | 1 -
|
|
|
f351e7 |
lib/metadata/lv_manip.c | 78 ++++++++++++---------------------
|
|
|
f351e7 |
lib/metadata/metadata-exported.h | 2 -
|
|
|
f351e7 |
lib/metadata/pool_manip.c | 6 +--
|
|
|
f351e7 |
test/lib/aux.sh | 1 -
|
|
|
f351e7 |
test/shell/lvcreate-signature-wiping.sh | 7 ---
|
|
|
f351e7 |
test/shell/lvcreate-thin.sh | 21 ---------
|
|
|
f351e7 |
tools/lvconvert.c | 12 ++---
|
|
|
f351e7 |
11 files changed, 36 insertions(+), 105 deletions(-)
|
|
|
f351e7 |
|
|
|
f351e7 |
diff --git a/WHATS_NEW b/WHATS_NEW
|
|
|
f351e7 |
index ac99e97..6a098b5 100644
|
|
|
f351e7 |
--- a/WHATS_NEW
|
|
|
f351e7 |
+++ b/WHATS_NEW
|
|
|
f351e7 |
@@ -6,8 +6,6 @@ Version 2.03.10 -
|
|
|
f351e7 |
warning.
|
|
|
f351e7 |
Fix conversion to raid from striped lagging type.
|
|
|
f351e7 |
Fix conversion to 'mirrored' mirror log with larger regionsize.
|
|
|
f351e7 |
- Zero pool metadata on allocation (disable with allocation/zero_metadata=0).
|
|
|
f351e7 |
- Failure in zeroing or wiping will fail command (bypass with -Zn, -Wn).
|
|
|
f351e7 |
Fix running out of free buffers for async writing for larger writes.
|
|
|
f351e7 |
Add integrity with raid capability.
|
|
|
f351e7 |
Fix support for lvconvert --repair used by foreign apps (i.e. Docker).
|
|
|
f351e7 |
diff --git a/conf/example.conf.in b/conf/example.conf.in
|
|
|
f351e7 |
index d5807e6..88858fc 100644
|
|
|
f351e7 |
--- a/conf/example.conf.in
|
|
|
f351e7 |
+++ b/conf/example.conf.in
|
|
|
f351e7 |
@@ -489,7 +489,7 @@ allocation {
|
|
|
f351e7 |
# This configuration option does not have a default value defined.
|
|
|
f351e7 |
|
|
|
f351e7 |
# Configuration option allocation/thin_pool_metadata_require_separate_pvs.
|
|
|
f351e7 |
- # Thin pool metadata and data will always use different PVs.
|
|
|
f351e7 |
+ # Thin pool metdata and data will always use different PVs.
|
|
|
f351e7 |
thin_pool_metadata_require_separate_pvs = 0
|
|
|
f351e7 |
|
|
|
f351e7 |
# Configuration option allocation/thin_pool_zero.
|
|
|
f351e7 |
@@ -527,10 +527,6 @@ allocation {
|
|
|
f351e7 |
# This configuration option has an automatic default value.
|
|
|
f351e7 |
# thin_pool_chunk_size_policy = "generic"
|
|
|
f351e7 |
|
|
|
f351e7 |
- # Configuration option allocation/zero_metadata.
|
|
|
f351e7 |
- # Zero whole metadata area before use with thin or cache pool.
|
|
|
f351e7 |
- zero_metadata = 1
|
|
|
f351e7 |
-
|
|
|
f351e7 |
# Configuration option allocation/thin_pool_chunk_size.
|
|
|
f351e7 |
# The minimal chunk size in KiB for thin pool volumes.
|
|
|
f351e7 |
# Larger chunk sizes may improve performance for plain thin volumes,
|
|
|
f351e7 |
diff --git a/lib/config/config_settings.h b/lib/config/config_settings.h
|
|
|
f351e7 |
index b38ca11..dce9705 100644
|
|
|
f351e7 |
--- a/lib/config/config_settings.h
|
|
|
f351e7 |
+++ b/lib/config/config_settings.h
|
|
|
f351e7 |
@@ -626,7 +626,7 @@ cfg(allocation_cache_pool_max_chunks_CFG, "cache_pool_max_chunks", allocation_CF
|
|
|
f351e7 |
"Using cache pool with more chunks may degrade cache performance.\n")
|
|
|
f351e7 |
|
|
|
f351e7 |
cfg(allocation_thin_pool_metadata_require_separate_pvs_CFG, "thin_pool_metadata_require_separate_pvs", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_METADATA_REQUIRE_SEPARATE_PVS, vsn(2, 2, 89), NULL, 0, NULL,
|
|
|
f351e7 |
- "Thin pool metadata and data will always use different PVs.\n")
|
|
|
f351e7 |
+ "Thin pool metdata and data will always use different PVs.\n")
|
|
|
f351e7 |
|
|
|
f351e7 |
cfg(allocation_thin_pool_zero_CFG, "thin_pool_zero", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_COMMENTED, CFG_TYPE_BOOL, DEFAULT_THIN_POOL_ZERO, vsn(2, 2, 99), NULL, 0, NULL,
|
|
|
f351e7 |
"Thin pool data chunks are zeroed before they are first used.\n"
|
|
|
f351e7 |
@@ -657,9 +657,6 @@ cfg(allocation_thin_pool_chunk_size_policy_CFG, "thin_pool_chunk_size_policy", a
|
|
|
f351e7 |
" 512KiB.\n"
|
|
|
f351e7 |
"#\n")
|
|
|
f351e7 |
|
|
|
f351e7 |
-cfg(allocation_zero_metadata_CFG, "zero_metadata", allocation_CFG_SECTION, 0, CFG_TYPE_BOOL, DEFAULT_ZERO_METADATA, vsn(2, 3, 10), NULL, 0, NULL,
|
|
|
f351e7 |
- "Zero whole metadata area before use with thin or cache pool.\n")
|
|
|
f351e7 |
-
|
|
|
f351e7 |
cfg_runtime(allocation_thin_pool_chunk_size_CFG, "thin_pool_chunk_size", allocation_CFG_SECTION, CFG_PROFILABLE | CFG_PROFILABLE_METADATA | CFG_DEFAULT_UNDEFINED, CFG_TYPE_INT, vsn(2, 2, 99), 0, NULL,
|
|
|
f351e7 |
"The minimal chunk size in KiB for thin pool volumes.\n"
|
|
|
f351e7 |
"Larger chunk sizes may improve performance for plain thin volumes,\n"
|
|
|
f351e7 |
diff --git a/lib/config/defaults.h b/lib/config/defaults.h
|
|
|
f351e7 |
index 708a575..be4f5ff 100644
|
|
|
f351e7 |
--- a/lib/config/defaults.h
|
|
|
f351e7 |
+++ b/lib/config/defaults.h
|
|
|
f351e7 |
@@ -129,7 +129,6 @@
|
|
|
f351e7 |
#define DEFAULT_THIN_POOL_DISCARDS "passdown"
|
|
|
f351e7 |
#define DEFAULT_THIN_POOL_ZERO 1
|
|
|
f351e7 |
#define DEFAULT_POOL_METADATA_SPARE 1 /* thin + cache */
|
|
|
f351e7 |
-#define DEFAULT_ZERO_METADATA 1 /* thin + cache */
|
|
|
f351e7 |
|
|
|
f351e7 |
#ifdef CACHE_CHECK_NEEDS_CHECK
|
|
|
f351e7 |
# define DEFAULT_CACHE_CHECK_OPTION1 "-q"
|
|
|
f351e7 |
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
|
|
|
f351e7 |
index f0ba3f0..1642b90 100644
|
|
|
f351e7 |
--- a/lib/metadata/lv_manip.c
|
|
|
f351e7 |
+++ b/lib/metadata/lv_manip.c
|
|
|
f351e7 |
@@ -7576,22 +7576,20 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
|
|
|
f351e7 |
struct device *dev;
|
|
|
f351e7 |
char name[PATH_MAX];
|
|
|
f351e7 |
uint64_t zero_sectors;
|
|
|
f351e7 |
- int zero_metadata = wp.is_metadata ?
|
|
|
f351e7 |
- find_config_tree_bool(lv->vg->cmd, allocation_zero_metadata_CFG, NULL) : 0;
|
|
|
f351e7 |
|
|
|
f351e7 |
- if (!wp.do_zero && !wp.do_wipe_signatures && !wp.is_metadata)
|
|
|
f351e7 |
+ if (!wp.do_zero && !wp.do_wipe_signatures)
|
|
|
f351e7 |
/* nothing to do */
|
|
|
f351e7 |
return 1;
|
|
|
f351e7 |
|
|
|
f351e7 |
if (!lv_is_active(lv)) {
|
|
|
f351e7 |
- log_error("Volume %s is not active locally (volume_list activation filter?).",
|
|
|
f351e7 |
- display_lvname(lv));
|
|
|
f351e7 |
+ log_error("Volume \"%s/%s\" is not active locally (volume_list activation filter?).",
|
|
|
f351e7 |
+ lv->vg->name, lv->name);
|
|
|
f351e7 |
return 0;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
/* Wait until devices are available */
|
|
|
f351e7 |
if (!sync_local_dev_names(lv->vg->cmd)) {
|
|
|
f351e7 |
- log_error("Failed to sync local devices before wiping volume %s.",
|
|
|
f351e7 |
+ log_error("Failed to sync local devices before wiping LV %s.",
|
|
|
f351e7 |
display_lvname(lv));
|
|
|
f351e7 |
return 0;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
@@ -7615,59 +7613,40 @@ int wipe_lv(struct logical_volume *lv, struct wipe_params wp)
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
if (!label_scan_open_rw(dev)) {
|
|
|
f351e7 |
- log_error("Failed to open %s for wiping and zeroing.", display_lvname(lv));
|
|
|
f351e7 |
- return 0;
|
|
|
f351e7 |
+ log_error("Failed to open %s/%s for wiping and zeroing.", lv->vg->name, lv->name);
|
|
|
f351e7 |
+ goto out;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
if (wp.do_wipe_signatures) {
|
|
|
f351e7 |
- log_verbose("Wiping known signatures on logical volume %s.",
|
|
|
f351e7 |
- display_lvname(lv));
|
|
|
f351e7 |
+ log_verbose("Wiping known signatures on logical volume \"%s/%s\"",
|
|
|
f351e7 |
+ lv->vg->name, lv->name);
|
|
|
f351e7 |
if (!wipe_known_signatures(lv->vg->cmd, dev, name, 0,
|
|
|
f351e7 |
TYPE_DM_SNAPSHOT_COW,
|
|
|
f351e7 |
- wp.yes, wp.force, NULL)) {
|
|
|
f351e7 |
- log_error("Filed to wipe signatures of logical volume %s.",
|
|
|
f351e7 |
- display_lvname(lv));
|
|
|
f351e7 |
- return 0;
|
|
|
f351e7 |
- }
|
|
|
f351e7 |
+ wp.yes, wp.force, NULL))
|
|
|
f351e7 |
+ stack;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
- if (wp.do_zero || wp.is_metadata) {
|
|
|
f351e7 |
- zero_metadata = !wp.is_metadata ? 0 :
|
|
|
f351e7 |
- find_config_tree_bool(lv->vg->cmd, allocation_zero_metadata_CFG, NULL);
|
|
|
f351e7 |
- if (zero_metadata) {
|
|
|
f351e7 |
- log_debug("Metadata logical volume %s will be fully zeroed.",
|
|
|
f351e7 |
- display_lvname(lv));
|
|
|
f351e7 |
- zero_sectors = lv->size;
|
|
|
f351e7 |
- } else {
|
|
|
f351e7 |
- if (wp.is_metadata) /* Verbosely notify metadata will not be fully zeroed */
|
|
|
f351e7 |
- log_verbose("Metadata logical volume %s not fully zeroed and may contain stale data.",
|
|
|
f351e7 |
- display_lvname(lv));
|
|
|
f351e7 |
- zero_sectors = UINT64_C(4096) >> SECTOR_SHIFT;
|
|
|
f351e7 |
- if (wp.zero_sectors > zero_sectors)
|
|
|
f351e7 |
- zero_sectors = wp.zero_sectors;
|
|
|
f351e7 |
+ if (wp.do_zero) {
|
|
|
f351e7 |
+ zero_sectors = wp.zero_sectors ? : UINT64_C(4096) >> SECTOR_SHIFT;
|
|
|
f351e7 |
|
|
|
f351e7 |
- if (zero_sectors > lv->size)
|
|
|
f351e7 |
- zero_sectors = lv->size;
|
|
|
f351e7 |
- }
|
|
|
f351e7 |
+ if (zero_sectors > lv->size)
|
|
|
f351e7 |
+ zero_sectors = lv->size;
|
|
|
f351e7 |
|
|
|
f351e7 |
- log_verbose("Initializing %s of logical volume %s with value %d.",
|
|
|
f351e7 |
+ log_verbose("Initializing %s of logical volume \"%s/%s\" with value %d.",
|
|
|
f351e7 |
display_size(lv->vg->cmd, zero_sectors),
|
|
|
f351e7 |
- display_lvname(lv), wp.zero_value);
|
|
|
f351e7 |
-
|
|
|
f351e7 |
- if ((!wp.is_metadata &&
|
|
|
f351e7 |
- wp.zero_value && !dev_set_bytes(dev, UINT64_C(0),
|
|
|
f351e7 |
- (size_t) zero_sectors << SECTOR_SHIFT,
|
|
|
f351e7 |
- (uint8_t)wp.zero_value)) ||
|
|
|
f351e7 |
- !dev_write_zeros(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT)) {
|
|
|
f351e7 |
- log_error("Failed to initialize %s of logical volume %s with value %d.",
|
|
|
f351e7 |
- display_size(lv->vg->cmd, zero_sectors),
|
|
|
f351e7 |
- display_lvname(lv), wp.zero_value);
|
|
|
f351e7 |
- return 0;
|
|
|
f351e7 |
+ lv->vg->name, lv->name, wp.zero_value);
|
|
|
f351e7 |
+
|
|
|
f351e7 |
+ if (!wp.zero_value) {
|
|
|
f351e7 |
+ if (!dev_write_zeros(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT))
|
|
|
f351e7 |
+ stack;
|
|
|
f351e7 |
+ } else {
|
|
|
f351e7 |
+ if (!dev_set_bytes(dev, UINT64_C(0), (size_t) zero_sectors << SECTOR_SHIFT, (uint8_t)wp.zero_value))
|
|
|
f351e7 |
+ stack;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
label_scan_invalidate(dev);
|
|
|
f351e7 |
-
|
|
|
f351e7 |
+out:
|
|
|
f351e7 |
lv->status &= ~LV_NOSCAN;
|
|
|
f351e7 |
|
|
|
f351e7 |
return 1;
|
|
|
f351e7 |
@@ -7731,10 +7710,12 @@ int activate_and_wipe_lvlist(struct dm_list *lv_list, int commit)
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
dm_list_iterate_items(lvl, lv_list) {
|
|
|
f351e7 |
+ log_verbose("Wiping metadata area %s.", display_lvname(lvl->lv));
|
|
|
f351e7 |
/* Wipe any know signatures */
|
|
|
f351e7 |
- if (!wipe_lv(lvl->lv, (struct wipe_params) { .do_zero = 1 /* TODO: is_metadata = 1 */ })) {
|
|
|
f351e7 |
+ if (!wipe_lv(lvl->lv, (struct wipe_params) { .do_wipe_signatures = 1, .do_zero = 1, .zero_sectors = 1 })) {
|
|
|
f351e7 |
+ log_error("Failed to wipe %s.", display_lvname(lvl->lv));
|
|
|
f351e7 |
r = 0;
|
|
|
f351e7 |
- goto_out;
|
|
|
f351e7 |
+ goto out;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
}
|
|
|
f351e7 |
out:
|
|
|
f351e7 |
@@ -8479,8 +8460,7 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg,
|
|
|
f351e7 |
.do_zero = lp->zero,
|
|
|
f351e7 |
.do_wipe_signatures = lp->wipe_signatures,
|
|
|
f351e7 |
.yes = lp->yes,
|
|
|
f351e7 |
- .force = lp->force,
|
|
|
f351e7 |
- .is_metadata = lp->is_metadata,
|
|
|
f351e7 |
+ .force = lp->force
|
|
|
f351e7 |
})) {
|
|
|
f351e7 |
log_error("Aborting. Failed to wipe %s.", lp->snapshot
|
|
|
f351e7 |
? "snapshot exception store" : "start of new LV");
|
|
|
f351e7 |
diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h
|
|
|
f351e7 |
index 06ea757..0cc5f37 100644
|
|
|
f351e7 |
--- a/lib/metadata/metadata-exported.h
|
|
|
f351e7 |
+++ b/lib/metadata/metadata-exported.h
|
|
|
f351e7 |
@@ -803,7 +803,6 @@ struct wipe_params {
|
|
|
f351e7 |
int do_wipe_signatures; /* should we wipe known signatures found on LV? */
|
|
|
f351e7 |
int yes; /* answer yes automatically to all questions */
|
|
|
f351e7 |
force_t force; /* force mode */
|
|
|
f351e7 |
- int is_metadata; /* wipe volume is metadata LV */
|
|
|
f351e7 |
};
|
|
|
f351e7 |
|
|
|
f351e7 |
/* Zero out LV and/or wipe signatures */
|
|
|
f351e7 |
@@ -956,7 +955,6 @@ struct lvcreate_params {
|
|
|
f351e7 |
unsigned suppress_zero_warn : 1;
|
|
|
f351e7 |
unsigned needs_lockd_init : 1;
|
|
|
f351e7 |
unsigned ignore_type : 1;
|
|
|
f351e7 |
- unsigned is_metadata : 1; /* created LV will be used as metadata LV (and can be zeroed) */
|
|
|
f351e7 |
|
|
|
f351e7 |
const char *vg_name; /* only-used when VG is not yet opened (in /tools) */
|
|
|
f351e7 |
const char *lv_name; /* all */
|
|
|
f351e7 |
diff --git a/lib/metadata/pool_manip.c b/lib/metadata/pool_manip.c
|
|
|
f351e7 |
index 23b5b63..bed51f1 100644
|
|
|
f351e7 |
--- a/lib/metadata/pool_manip.c
|
|
|
f351e7 |
+++ b/lib/metadata/pool_manip.c
|
|
|
f351e7 |
@@ -545,8 +545,8 @@ int create_pool(struct logical_volume *pool_lv,
|
|
|
f351e7 |
display_lvname(pool_lv));
|
|
|
f351e7 |
goto bad;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
- /* Clear pool metadata device. */
|
|
|
f351e7 |
- if (!(r = wipe_lv(pool_lv, (struct wipe_params) { .is_metadata = 1 }))) {
|
|
|
f351e7 |
+ /* Clear 4KB of pool metadata device. */
|
|
|
f351e7 |
+ if (!(r = wipe_lv(pool_lv, (struct wipe_params) { .do_zero = 1 }))) {
|
|
|
f351e7 |
log_error("Aborting. Failed to wipe pool metadata %s.",
|
|
|
f351e7 |
display_lvname(pool_lv));
|
|
|
f351e7 |
}
|
|
|
f351e7 |
@@ -627,7 +627,6 @@ struct logical_volume *alloc_pool_metadata(struct logical_volume *pool_lv,
|
|
|
f351e7 |
.tags = DM_LIST_HEAD_INIT(lvc.tags),
|
|
|
f351e7 |
.temporary = 1,
|
|
|
f351e7 |
.zero = 1,
|
|
|
f351e7 |
- .is_metadata = 1,
|
|
|
f351e7 |
};
|
|
|
f351e7 |
|
|
|
f351e7 |
if (!(lvc.segtype = get_segtype_from_string(pool_lv->vg->cmd, SEG_TYPE_NAME_STRIPED)))
|
|
|
f351e7 |
@@ -664,7 +663,6 @@ static struct logical_volume *_alloc_pool_metadata_spare(struct volume_group *vg
|
|
|
f351e7 |
.tags = DM_LIST_HEAD_INIT(lp.tags),
|
|
|
f351e7 |
.temporary = 1,
|
|
|
f351e7 |
.zero = 1,
|
|
|
f351e7 |
- .is_metadata = 1,
|
|
|
f351e7 |
};
|
|
|
f351e7 |
|
|
|
f351e7 |
if (!(lp.segtype = get_segtype_from_string(vg->cmd, SEG_TYPE_NAME_STRIPED)))
|
|
|
f351e7 |
diff --git a/test/lib/aux.sh b/test/lib/aux.sh
|
|
|
f351e7 |
index 17e7935..e40da95 100644
|
|
|
f351e7 |
--- a/test/lib/aux.sh
|
|
|
f351e7 |
+++ b/test/lib/aux.sh
|
|
|
f351e7 |
@@ -1234,7 +1234,6 @@ activation/verify_udev_operations = $LVM_VERIFY_UDEV
|
|
|
f351e7 |
activation/raid_region_size = 512
|
|
|
f351e7 |
allocation/wipe_signatures_when_zeroing_new_lvs = 0
|
|
|
f351e7 |
allocation/vdo_slab_size_mb = 128
|
|
|
f351e7 |
-allocation/zero_metadata = 0
|
|
|
f351e7 |
backup/archive = 0
|
|
|
f351e7 |
backup/backup = 0
|
|
|
f351e7 |
devices/cache_dir = "$TESTDIR/etc"
|
|
|
f351e7 |
diff --git a/test/shell/lvcreate-signature-wiping.sh b/test/shell/lvcreate-signature-wiping.sh
|
|
|
f351e7 |
index 18d7a2f..73fea54 100644
|
|
|
f351e7 |
--- a/test/shell/lvcreate-signature-wiping.sh
|
|
|
f351e7 |
+++ b/test/shell/lvcreate-signature-wiping.sh
|
|
|
f351e7 |
@@ -42,13 +42,6 @@ init_lv_
|
|
|
f351e7 |
test_blkid_ || skip
|
|
|
f351e7 |
lvremove -f $vg/$lv1
|
|
|
f351e7 |
|
|
|
f351e7 |
-# Zeroing stops the command when there is a failure (write error in this case)
|
|
|
f351e7 |
-aux error_dev "$dev1" "$(get first_extent_sector "$dev1"):2"
|
|
|
f351e7 |
-not lvcreate -l1 -n $lv1 $vg 2>&1 | tee out
|
|
|
f351e7 |
-grep "Failed to initialize" out
|
|
|
f351e7 |
-aux enable_dev "$dev1"
|
|
|
f351e7 |
-
|
|
|
f351e7 |
-
|
|
|
f351e7 |
aux lvmconf "allocation/wipe_signatures_when_zeroing_new_lvs = 0"
|
|
|
f351e7 |
|
|
|
f351e7 |
lvcreate -y -Zn -l1 -n $lv1 $vg 2>&1 | tee out
|
|
|
f351e7 |
diff --git a/test/shell/lvcreate-thin.sh b/test/shell/lvcreate-thin.sh
|
|
|
f351e7 |
index c073eaf..9ca7f11 100644
|
|
|
f351e7 |
--- a/test/shell/lvcreate-thin.sh
|
|
|
f351e7 |
+++ b/test/shell/lvcreate-thin.sh
|
|
|
f351e7 |
@@ -248,25 +248,4 @@ not lvcreate -s $vg/lv1 -L4M -V2G --name $vg/lv4
|
|
|
f351e7 |
not lvcreate -T mirpool -L4M --alloc anywhere -m1 $vg
|
|
|
f351e7 |
not lvcreate --thinpool mirpool -L4M --alloc anywhere -m1 $vg
|
|
|
f351e7 |
|
|
|
f351e7 |
-
|
|
|
f351e7 |
-# Check pool metadata volume is zeroed, when zero_metadata is enabled.
|
|
|
f351e7 |
-# 1st. ensure 8megs of both PVs will have some non-0 data
|
|
|
f351e7 |
-lvcreate -L8m -n $lv1 $vg "$dev1"
|
|
|
f351e7 |
-lvextend -L+8m $vg/$lv1 "$dev2"
|
|
|
f351e7 |
-dd if=/dev/urandom of="$DM_DEV_DIR/$vg/$lv1" bs=1M count=16 oflag=direct conv=fdatasync
|
|
|
f351e7 |
-lvremove -ff $vg/$lv1
|
|
|
f351e7 |
-
|
|
|
f351e7 |
-lvcreate -l1 --poolmetadatasize 4m --conf 'allocation/zero_metadata=1' -vvvv -T $vg/pool
|
|
|
f351e7 |
-lvchange -an $vg
|
|
|
f351e7 |
-# component activation to check device was zeroed
|
|
|
f351e7 |
-lvchange -y -ay $vg/pool_tmeta
|
|
|
f351e7 |
-dd if="$DM_DEV_DIR/$vg/pool_tmeta" of=file bs=1M count=3 skip=1 iflag=direct conv=fdatasync
|
|
|
f351e7 |
-
|
|
|
f351e7 |
-md5sum -b file | tee out
|
|
|
f351e7 |
-# md5sum of 3M of zeros
|
|
|
f351e7 |
-grep d1dd210d6b1312cb342b56d02bd5e651 out
|
|
|
f351e7 |
-lvchange -an $vg
|
|
|
f351e7 |
-lvremove -ff $vg
|
|
|
f351e7 |
-
|
|
|
f351e7 |
-
|
|
|
f351e7 |
vgremove -ff $vg
|
|
|
f351e7 |
diff --git a/tools/lvconvert.c b/tools/lvconvert.c
|
|
|
f351e7 |
index 524ed5a..6324ed7 100644
|
|
|
f351e7 |
--- a/tools/lvconvert.c
|
|
|
f351e7 |
+++ b/tools/lvconvert.c
|
|
|
f351e7 |
@@ -3286,11 +3286,7 @@ static int _lvconvert_to_pool(struct cmd_context *cmd,
|
|
|
f351e7 |
}
|
|
|
f351e7 |
metadata_lv->status &= ~LV_ACTIVATION_SKIP;
|
|
|
f351e7 |
|
|
|
f351e7 |
- if (!wipe_lv(metadata_lv, (struct wipe_params) {
|
|
|
f351e7 |
- .do_wipe_signatures = 1,
|
|
|
f351e7 |
- .is_metadata = 1,
|
|
|
f351e7 |
- .yes = arg_count(cmd, yes_ARG),
|
|
|
f351e7 |
- .force = arg_count(cmd, force_ARG) } )) {
|
|
|
f351e7 |
+ if (!wipe_lv(metadata_lv, (struct wipe_params) { .do_zero = 1 })) {
|
|
|
f351e7 |
log_error("Aborting. Failed to wipe metadata lv.");
|
|
|
f351e7 |
goto bad;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
@@ -5527,8 +5523,7 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
|
|
|
f351e7 |
struct wipe_params wp = {
|
|
|
f351e7 |
.do_wipe_signatures = 1, /* optional, to print warning if clobbering something */
|
|
|
f351e7 |
.do_zero = 1, /* required for dm-writecache to work */
|
|
|
f351e7 |
- .yes = arg_count(cmd, yes_ARG),
|
|
|
f351e7 |
- .force = arg_count(cmd, force_ARG)
|
|
|
f351e7 |
+ .zero_sectors = 1
|
|
|
f351e7 |
};
|
|
|
f351e7 |
int ret;
|
|
|
f351e7 |
|
|
|
f351e7 |
@@ -5545,8 +5540,7 @@ static int _writecache_zero(struct cmd_context *cmd, struct logical_volume *lv)
|
|
|
f351e7 |
return 0;
|
|
|
f351e7 |
}
|
|
|
f351e7 |
|
|
|
f351e7 |
- if (!(ret = wipe_lv(lv, wp)))
|
|
|
f351e7 |
- stack;
|
|
|
f351e7 |
+ ret = wipe_lv(lv, wp);
|
|
|
f351e7 |
|
|
|
f351e7 |
if (!deactivate_lv(cmd, lv)) {
|
|
|
f351e7 |
log_error("Failed to deactivate LV %s for zeroing.", display_lvname(lv));
|
|
|
f351e7 |
--
|
|
|
f351e7 |
1.8.3.1
|
|
|
f351e7 |
|