summaryrefslogtreecommitdiff
path: root/tools/toollib.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/toollib.c')
-rw-r--r--tools/toollib.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/toollib.c b/tools/toollib.c
index 9d488c5a7..5f5420825 100644
--- a/tools/toollib.c
+++ b/tools/toollib.c
@@ -5336,6 +5336,10 @@ int pvcreate_each_device(struct cmd_context *cmd,
if (cmd->enable_devices_file && !pp->is_remove)
cmd->filter_deviceid_skip = 1;
+ /* pvcreate -f overwrites partitions */
+ if (pp->force && !pp->is_remove)
+ cmd->filter_partitioned_skip = 1;
+
log_debug("Scanning and filtering device args (%u).", dm_list_size(&scan_devs));
label_scan_devs(cmd, cmd->filter, &scan_devs);
@@ -5350,6 +5354,7 @@ int pvcreate_each_device(struct cmd_context *cmd,
}
}
cmd->filter_deviceid_skip = 0;
+ cmd->filter_partitioned_skip = 0;
/*
* Can the command continue if some specified devices were not found?
@@ -5562,6 +5567,9 @@ do_command:
if (cmd->enable_devices_file && !pp->is_remove)
cmd->filter_deviceid_skip = 1;
+ if (pp->force && !pp->is_remove)
+ cmd->filter_partitioned_skip = 1;
+
log_debug("Rescanning and filtering device args with exclusive open");
if (!label_scan_devs_excl(cmd, cmd->filter, &rescan_devs)) {
log_debug("Failed to rescan devs excl");
@@ -5575,7 +5583,9 @@ do_command:
dm_list_add(&pp->arg_fail, &pd->list);
}
}
+
cmd->filter_deviceid_skip = 0;
+ cmd->filter_partitioned_skip = 0;
if (dm_list_empty(&pp->arg_process) && dm_list_empty(&remove_duplicates)) {
log_debug("No devices to process.");