diff options
Diffstat (limited to 'device_mapper/ioctl/libdm-iface.c')
-rw-r--r-- | device_mapper/ioctl/libdm-iface.c | 31 |
1 files changed, 27 insertions, 4 deletions
diff --git a/device_mapper/ioctl/libdm-iface.c b/device_mapper/ioctl/libdm-iface.c index fe04af8bf..25e7d1a75 100644 --- a/device_mapper/ioctl/libdm-iface.c +++ b/device_mapper/ioctl/libdm-iface.c @@ -805,6 +805,11 @@ int dm_task_suppress_identical_reload(struct dm_task *dmt) return 1; } +void dm_task_skip_reload_params_compare(struct dm_task *dmt) +{ + dmt->skip_reload_params_compare = 1; +} + int dm_task_set_add_node(struct dm_task *dmt, dm_add_node_t add_node) { switch (add_node) { @@ -1575,11 +1580,29 @@ static int _reload_with_suppression_v4(struct dm_task *dmt) len = strlen(t2->params); while (len-- > 0 && t2->params[len] == ' ') t2->params[len] = '\0'; - if ((t1->start != t2->start) || - (t1->length != t2->length) || - (strcmp(t1->type, t2->type)) || - (strcmp(t1->params, t2->params))) + + if (t1->start != t2->start) { + log_debug("reload %u:%u start diff", task->major, task->minor); + goto no_match; + } + if (t1->length != t2->length) { + log_debug("reload %u:%u length diff", task->major, task->minor); goto no_match; + } + if (strcmp(t1->type, t2->type)) { + log_debug("reload %u:%u type diff %s %s", task->major, task->minor, t1->type, t2->type); + goto no_match; + } + if (strcmp(t1->params, t2->params)) { + if (dmt->skip_reload_params_compare) + log_debug("reload %u:%u skip params ignore %s %s", + task->major, task->minor, t1->params, t2->params); + else { + log_debug("reload %u:%u params diff", task->major, task->minor); + goto no_match; + } + } + t1 = t1->next; t2 = t2->next; } |