]> sourceware.org Git - lvm2.git/commitdiff
rename pvscan_cache_single to expect_missing_vg_device in cmd
authorDavid Teigland <teigland@redhat.com>
Wed, 3 Nov 2021 14:50:11 +0000 (09:50 -0500)
committerDavid Teigland <teigland@redhat.com>
Thu, 4 Nov 2021 16:08:38 +0000 (11:08 -0500)
lib/commands/toolcontext.h
lib/device/device_id.c
lib/metadata/metadata.c
tools/pvscan.c

index e864932f2b0d97ef45f4bbd1ec957a385e9fa06b..0ae45ccc08a024360abbc0e6c08d03d80d8ed23f 100644 (file)
@@ -174,7 +174,7 @@ struct cmd_context {
        unsigned activate_component:1;          /* command activates component LV */
        unsigned process_component_lvs:1;       /* command processes also component LVs */
        unsigned mirror_warn_printed:1;         /* command already printed warning about non-monitored mirrors */
-       unsigned pvscan_cache_single:1;
+       unsigned expect_missing_vg_device:1;    /* when reading a vg it's expected that a dev for a pv isn't found */
        unsigned can_use_one_scan:1;
        unsigned is_clvmd:1;
        unsigned md_component_detection:1;
index 167bf661bf6765b4c62b1d92941ee551ee8a9df0..18669630c63567998588ec61f6582f349c7dd4a3 100644 (file)
@@ -778,9 +778,8 @@ static void _device_ids_update_try(struct cmd_context *cmd)
 {
        int held = 0;
 
-       /* Defer updates to non-pvscan-cache commands. */
-       if (cmd->pvscan_cache_single) {
-               log_print("pvscan[%d] skip updating devices file.", getpid());
+       if (cmd->expect_missing_vg_device) {
+               log_print("skip updating devices file.");
                return;
        }
 
index c4f65366b57d9a7a1864e98b9d33f4434b79b5b2..f01a0bea6145d16e00c904b9aa32f5c9717b77f3 100644 (file)
@@ -3558,7 +3558,7 @@ static void _set_pv_device(struct format_instance *fid,
                if (!id_write_format(&pv->id, buffer, sizeof(buffer)))
                        buffer[0] = '\0';
 
-               if (cmd && !cmd->pvscan_cache_single &&
+               if (cmd && !cmd->expect_missing_vg_device &&
                    (!vg_is_foreign(vg) && !cmd->include_foreign_vgs))
                        log_warn("WARNING: Couldn't find device with uuid %s.", buffer);
                else
@@ -5084,7 +5084,7 @@ struct volume_group *vg_read(struct cmd_context *cmd, const char *vg_name, const
                if (!pvl->pv->dev) {
                        /* The obvious and common case of a missing device. */
 
-                       if (vg_is_foreign(vg) && !cmd->include_foreign_vgs)
+                       if ((vg_is_foreign(vg) && !cmd->include_foreign_vgs) || cmd->expect_missing_vg_device)
                                log_debug("VG %s is missing PV %s (last written to %s)", vg_name, uuidstr, pvl->pv->device_hint ?: "na");
                        else if (pvl->pv->device_hint)
                                log_warn("WARNING: VG %s is missing PV %s (last written to %s).", vg_name, uuidstr, pvl->pv->device_hint);
index 01f57af0c0df788dd58774ba768c285171198f2f..4f97e211cc6e7c8af8fd1c1eb77112a4d3ce9ce4 100644 (file)
@@ -1679,7 +1679,7 @@ static int _pvscan_cache_args(struct cmd_context *cmd, int argc, char **argv,
        dm_list_init(&pvscan_args);
        dm_list_init(&pvscan_devs);
 
-       cmd->pvscan_cache_single = 1;
+       cmd->expect_missing_vg_device = 1;
 
        /*
         * Special pvscan-specific setup steps to avoid looking
This page took 0.049038 seconds and 5 git commands to generate.