All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] multipath-tools: multipathd makes offline devices active
@ 2005-11-11 23:43 Kiyoshi Ueda
  2005-11-12  0:12 ` Christophe Varoqui
  0 siblings, 1 reply; 2+ messages in thread
From: Kiyoshi Ueda @ 2005-11-11 23:43 UTC (permalink / raw)
  To: christophe.varoqui, dm-devel

Hi Christophe,

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.

Any comments?


diff --git a/multipathd/main.c b/multipathd/main.c
index 4275a37..3d2848c 100644
--- a/multipathd/main.c
+++ b/multipathd/main.c
@@ -1239,7 +1239,12 @@ checkerloop (void *ap)
 			}
 			newstate = pp->checkfn(pp->fd, checker_msg,
 					       &pp->checker_context);
-			
+			if (newstate < 0) {
+				condlog(2, "%s: unusable path", pp->dev);
+				pathinfo(pp, conf->hwtable, 0);
+				continue;
+			}
+
 			if (newstate != pp->state) {
 				pp->state = newstate;
 				LOG_MSG(1, checker_msg);

Thanks,
Kiyoshi Ueda

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] multipath-tools: multipathd makes offline devices active
  2005-11-11 23:43 [PATCH] multipath-tools: multipathd makes offline devices active Kiyoshi Ueda
@ 2005-11-12  0:12 ` Christophe Varoqui
  0 siblings, 0 replies; 2+ messages in thread
From: Christophe Varoqui @ 2005-11-12  0:12 UTC (permalink / raw)
  To: device-mapper development

On ven, 2005-11-11 at 18:43 -0500, Kiyoshi Ueda wrote:
> Hi Christophe,
> 
> 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.
> 
Looks correct, indeed.
Thanks, applied.

Regards,
cvaroqui

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-11-12  0:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-11 23:43 [PATCH] multipath-tools: multipathd makes offline devices active Kiyoshi Ueda
2005-11-12  0:12 ` Christophe Varoqui

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.