diff options
Diffstat (limited to 'lib/label/hints.c')
-rw-r--r-- | lib/label/hints.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/label/hints.c b/lib/label/hints.c index 3ce9634f2..95d5d77b8 100644 --- a/lib/label/hints.c +++ b/lib/label/hints.c @@ -234,6 +234,7 @@ static int _touch_newhints(void) return_0; if (fclose(fp)) stack; + log_debug("newhints created"); return 1; } @@ -504,6 +505,19 @@ int validate_hints(struct cmd_context *cmd, struct dm_list *hints) if (!hint->chosen) continue; + /* + * label_scan was unable to read the dev so we don't know its pvid. + * Since we are unable to verify the hint is correct, it's possible + * that the PVID is actually found on a different device, so don't + * depend on hints. (This would also fail the following pvid check.) + */ + if (dev->flags & DEV_SCAN_NOT_READ) { + log_debug("Uncertain hint for unread device %d:%d %s", + major(hint->devt), minor(hint->devt), dev_name(dev)); + ret = 0; + continue; + } + if (strcmp(dev->pvid, hint->pvid)) { log_debug("Invalid hint device %d:%d %s pvid %s had hint pvid %s", major(hint->devt), minor(hint->devt), dev_name(dev), |