Commit d0259bf0eefc503d3c9c9ccda35033c3dd3aac30

Authored by Kiyoshi Ueda
Committed by Alasdair G Kergon
1 parent fce323dd68

dm mpath: hold io until all pg_inits completed

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>

Showing 1 changed file with 11 additions and 6 deletions Side-by-side Diff

drivers/md/dm-mpath.c
... ... @@ -1181,14 +1181,19 @@
1181 1181 m->current_pgpath = NULL;
1182 1182 m->current_pg = NULL;
1183 1183 }
1184   - } else if (!m->pg_init_required) {
1185   - m->queue_io = 0;
  1184 + } else if (!m->pg_init_required)
1186 1185 pg->bypassed = 0;
1187   - }
1188 1186  
1189   - m->pg_init_in_progress--;
1190   - if (!m->pg_init_in_progress)
1191   - queue_work(kmultipathd, &m->process_queued_ios);
  1187 + if (--m->pg_init_in_progress)
  1188 + /* Activations of other paths are still on going */
  1189 + goto out;
  1190 +
  1191 + if (!m->pg_init_required)
  1192 + m->queue_io = 0;
  1193 +
  1194 + queue_work(kmultipathd, &m->process_queued_ios);
  1195 +
  1196 +out:
1192 1197 spin_unlock_irqrestore(&m->lock, flags);
1193 1198 }
1194 1199