Skip to content

Commit

Permalink
dm mpath: hold io until all pg_inits completed
Browse files Browse the repository at this point in the history
m->queue_io is set to block processing I/Os, and it needs to be kept
while pg-init, which issues multiple path activations, is in progress.
But m->queue is cleared when a path activation completes without error
in pg_init_done(), even while other path activations are in progress.
That may cause undesired -EIO on paths which are not complete activation.

This patch fixes that by not clearing m->queue_io until all path
activations complete.

(Before the hardware handlers were moved into the SCSI layer, pg_init
only used one path.)

Signed-off-by: Kiyoshi Ueda <k-ueda@ct.jp.nec.com>
Signed-off-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Kiyoshi Ueda authored and Alasdair G Kergon committed Mar 6, 2010
1 parent fce323d commit d0259bf
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1181,14 +1181,19 @@ static void pg_init_done(void *data, int errors)
m->current_pgpath = NULL;
m->current_pg = NULL;
}
} else if (!m->pg_init_required) {
m->queue_io = 0;
} else if (!m->pg_init_required)
pg->bypassed = 0;
}

m->pg_init_in_progress--;
if (!m->pg_init_in_progress)
queue_work(kmultipathd, &m->process_queued_ios);
if (--m->pg_init_in_progress)
/* Activations of other paths are still on going */
goto out;

if (!m->pg_init_required)
m->queue_io = 0;

queue_work(kmultipathd, &m->process_queued_ios);

out:
spin_unlock_irqrestore(&m->lock, flags);
}

Expand Down

0 comments on commit d0259bf

Please sign in to comment.