Check for offline path in get_prio()
authorHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 07:35:34 +0000 (09:35 +0200)
committerHannes Reinecke <hare@suse.de>
Wed, 18 May 2011 07:35:34 +0000 (09:35 +0200)
We need to check for an offline path in get_prio(), otherwise
the priority callout might stall.

Signed-off-by: Hannes Reinecke <hare@suse.de>
libmultipath/discovery.c

index ef4e2a9..077e0cc 100644 (file)
@@ -819,6 +819,12 @@ get_prio (struct path * pp)
        if (!pp)
                return 0;
 
+       path_state = path_offline(pp);
+       if (path_state != PATH_UP) {
+               pp->priority = PRIO_UNDEF;
+               return 0;
+       }
+
        if (!pp->prio) {
                select_prio(pp);
                if (!pp->prio) {