[multipathd] fix offline devices reported as active
authorChristophe Varoqui <root@xa-s05.(none)>
Sat, 12 Nov 2005 00:09:18 +0000 (01:09 +0100)
committerChristophe Varoqui <root@xa-s05.(none)>
Sat, 12 Nov 2005 00:09:18 +0000 (01:09 +0100)
commit959873950f6c0f71ea2d4e0655e8ca8571979f25
treee3ef72417716d40fb7c4954f5ce472680d9adbd6
parent4c31aa399232c725e49709a9b4fe07c7222465d6
[multipathd] fix offline devices reported as active

multipathd(8) continues calling reinstate_path() in checkerloop(),
if multipathd(8) is started on the system which has multipath maps
including offline devices.
The reason is pp->checkfn() returns -1 for offline devices and
pp->state of these paths are 1.
(I'm using "echo offline > /sys/block/sd?/device/state" for the testing.)

As a result, multipathd(8) makes offline devices active state.
And this behavior also affects the no_path_retry feature, since
struct multipath.nr_active is incremented in reinstate_path().

The following patch fixes this problem.
If the return value from pp->checkfn is -1, the path isn't available.
So I think that we can ignore it.

Kiyoshi Ueda, NEC
multipathd/main.c