Blame SOURCES/0004-Revert-wipe_lv-changes.patch

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