Fix inconsistent entries after merging hwtable with user's config
authorPetr Uzel <petr.uzel@suse.cz>
Thu, 17 Jan 2013 14:59:26 +0000 (15:59 +0100)
committerChristophe Varoqui <christophe.varoqui@opensvc.com>
Fri, 18 Jan 2013 19:03:10 +0000 (20:03 +0100)
When merging the user provided configuration with the internal
hwtable entry in merge_hwe(), it can happen that the resulting
entry has a discrepancy between 'features' and 'no_path_retry'.
Check for this special case and fix it.

Signed-off-by: Petr Uzel <petr.uzel@suse.cz>
libmultipath/config.c

index b317e32..2d88226 100644 (file)
@@ -335,6 +335,15 @@ merge_hwe (struct hwentry * dst, struct hwentry * src)
        merge_num(retain_hwhandler);
        merge_num(detect_prio);
 
+       /*
+        * Make sure features is consistent with
+        * no_path_retry
+        */
+       if (dst->no_path_retry == NO_PATH_RETRY_FAIL)
+               remove_feature(&dst->features, "queue_if_no_path");
+       else if (dst->no_path_retry != NO_PATH_RETRY_UNDEF)
+               add_feature(&dst->features, "queue_if_no_path");
+
        return 0;
 }