Only one pg_init should happen on a device at once. But it's possible for __switch_pg to get called before the last pg_init completed.
A possible fix would be to set a pg_init_in_progress flag in process_queued_ios() together with clearing the pg_init_required flag, and not issue new pg_init ops while this is set. This flag would get cleared in dm_pg_init_complete(). That could be either done with an additional field or by converting pg_init_required to a pg_init_flags and PG_FLAG_REQUIRED, _IN_PROGRESS masks (which could potentially allow for future extensions; a _SUCCESS, _FAILED etc comes to mind). I can code a patch for either an additional field or the conversion to flags.
Created attachment 113521 [details] serialize pg_init calls via pg_init_in_progress Sketch of a patch. It compiles, I'll test it next ;)
"Works for me", please consider for udm inclusion...
Added it to my 'editing' directory.
*** Bug 154443 has been marked as a duplicate of this bug. ***
*** Bug 156576 has been marked as a duplicate of this bug. ***
Created attachment 116297 [details] Don't trigger process_queued_ios when there's no queue.
Comment on attachment 116297 [details] Don't trigger process_queued_ios when there's no queue. >Add to last patch: > Only reset queue_io in pg_init_complete if another pg_init isn't required. > Ensure process_queued_ios is never called if queue is empty. > >--- md-2.6.13-udm1-17/dm-mpath.c Sat Jul 2 20:10:33 2005 >+++ md-2.6.13-udm1-18/dm-mpath.c Sat Jul 2 22:53:48 2005 >@@ -337,7 +337,7 @@ static int queue_if_no_path(struct multi > > m->saved_queue_if_no_path = m->queue_if_no_path; > m->queue_if_no_path = queue_if_no_path; >- if (!m->queue_if_no_path) >+ if (!m->queue_if_no_path && m->queue_size) > queue_work(kmultipathd, &m->process_queued_ios); > > spin_unlock_irqrestore(&m->lock, flags); >@@ -856,7 +856,7 @@ static int reinstate_path(struct pgpath > pgpath->path.is_active = 1; > > m->current_pgpath = NULL; >- if (!m->nr_valid_paths++) >+ if (!m->nr_valid_paths++ && m->queue_size) > queue_work(kmultipathd, &m->process_queued_ios); > > queue_work(kmultipathd, &m->trigger_event); >@@ -990,12 +990,12 @@ void dm_pg_init_complete(struct path *pa > } > > spin_lock_irqsave(&m->lock, flags); >- if (!err_flags) >- m->queue_io = 0; >- else { >+ if (err_flags) { > m->current_pgpath = NULL; > m->current_pg = NULL; >- } >+ } else if (!m->pg_init_required) >+ m->queue_io = 0; >+ > m->pg_init_in_progress = 0; > queue_work(kmultipathd, &m->process_queued_ios); > spin_unlock_irqrestore(&m->lock, flags);
Created attachment 116298 [details] Don't trigger process_queued_ios when there's no queue. Second attempt at patch attachment...
patches submitted to -mm
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on the solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHSA-2005-514.html