From d588de77aa720b31ea54594b75a1182b7e3a5255 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 15 Sep 2020 16:40:53 +0200 Subject: [PATCH] wipe: convert zero_value to uint8_t We always write this value as byte. --- lib/metadata/metadata-exported.h | 4 ++-- lib/metadata/mirror.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/metadata/metadata-exported.h b/lib/metadata/metadata-exported.h index 670656a0f..b109d5b6d 100644 --- a/lib/metadata/metadata-exported.h +++ b/lib/metadata/metadata-exported.h @@ -797,9 +797,9 @@ struct logical_volume *lv_create_empty(const char *name, struct volume_group *vg); struct wipe_params { - int do_zero; /* should we do zeroing of LV start? */ uint64_t zero_sectors; /* sector count to zero */ - int zero_value; /* zero-out with this value */ + uint8_t zero_value; /* zero-out with this value */ + int do_zero; /* should we do zeroing of LV start? */ int do_wipe_signatures; /* should we wipe known signatures found on LV? */ int yes; /* answer yes automatically to all questions */ force_t force; /* force mode */ diff --git a/lib/metadata/mirror.c b/lib/metadata/mirror.c index d8803b3e3..c1934b5b7 100644 --- a/lib/metadata/mirror.c +++ b/lib/metadata/mirror.c @@ -325,8 +325,8 @@ static int _init_mirror_log(struct cmd_context *cmd, if (activation()) { if (!wipe_lv(log_lv, (struct wipe_params) - { .do_zero = 1, .zero_sectors = log_lv->size, - .zero_value = in_sync ? -1 : 0 })) { + { .zero_sectors = log_lv->size, .do_zero = 1, + .zero_value = in_sync ? 0xff : 0 })) { log_error("Aborting. Failed to wipe mirror log."); goto deactivate_and_revert_new_lv; }