summaryrefslogtreecommitdiff
path: root/tools/lvmdevices.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lvmdevices.c')
-rw-r--r--tools/lvmdevices.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/lvmdevices.c b/tools/lvmdevices.c
index 5d9c0c7b7..e58ab4490 100644
--- a/tools/lvmdevices.c
+++ b/tools/lvmdevices.c
@@ -124,6 +124,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
{
struct dm_list search_pvids;
struct dm_list found_devs;
+ struct dm_list scan_devs;
struct device_id_list *dil;
struct device_list *devl;
struct device *dev;
@@ -132,6 +133,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
dm_list_init(&search_pvids);
dm_list_init(&found_devs);
+ dm_list_init(&scan_devs);
if (!setup_devices_file(cmd))
return ECMD_FAILED;
@@ -186,6 +188,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
int update_set = arg_is_set(cmd, update_ARG);
int search_count = 0;
int update_needed = 0;
+ int serial_update_needed = 0;
int invalid = 0;
unlink_searched_devnames(cmd);
@@ -273,6 +276,9 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
}
}
+ if (!dm_list_empty(&cmd->device_ids_check_serial))
+ device_ids_check_serial(cmd, &scan_devs, &serial_update_needed, 1);
+
/*
* Find and fix any devname entries that have moved to a
* renamed device.
@@ -288,7 +294,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
}
if (arg_is_set(cmd, update_ARG)) {
- if (update_needed || !dm_list_empty(&found_devs)) {
+ if (update_needed || serial_update_needed || !dm_list_empty(&found_devs)) {
if (!device_ids_write(cmd))
goto_bad;
log_print("Updated devices file to version %s", devices_file_version());
@@ -301,7 +307,7 @@ int lvmdevices(struct cmd_context *cmd, int argc, char **argv)
* needs updates, i.e. running --update would make
* changes.
*/
- if (update_needed) {
+ if (update_needed || serial_update_needed) {
log_error("Updates needed for devices file.");
goto bad;
}