Do not check for valid mp context in get_state()
authorHannes Reinecke <hare@suse.de>
Thu, 30 Oct 2008 12:46:15 +0000 (13:46 +0100)
committerChristophe Varoqui <christophe.varoqui@free.fr>
Tue, 21 Apr 2009 21:42:07 +0000 (23:42 +0200)
When called from 'multipath -ll' get_state() does not
have a valid context. But the checkers should run nevertheless
as we need the state here but are not interested in any long-term
issues.

References: 433659

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

index 41b15be..b29c7b2 100644 (file)
@@ -694,15 +694,14 @@ get_state (struct path * pp)
 {
        struct checker * c = &pp->checker;
 
-       if (!pp->mpp)
-               return 0;
+       condlog(3, "%s: get_state", pp->dev);
 
        if (!checker_selected(c)) {
                select_checker(pp);
                if (!checker_selected(c))
                        return 1;
                checker_set_fd(c, pp->fd);
-               if (checker_init(c, &pp->mpp->mpcontext))
+               if (checker_init(c, pp->mpp?&pp->mpp->mpcontext:NULL))
                        return 1;
        }
        if (path_offline(pp)) {