aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/md
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2014-02-28 09:33:42 -0500
committerMike Snitzer <snitzer@redhat.com>2014-03-27 16:56:24 -0400
commit17f4ff45b58742e2cb32fce6e406dbdb4b32a1e7 (patch)
treeef392079dd18bd8dce3dae179786010fadfb0267 /drivers/md
parent9cdb8520049629271ad411ac91ab1bea3e1cfa2b (diff)
dm mpath: do not call pg_init when it is already running
This patch moves condition checks as a preparation of following patches and has no effect on behaviour. process_queued_ios() is the only caller of __pg_init_all_paths() and 2 condition checks are moved from outside to inside without side effects. Signed-off-by: Hannes Reinecke <hare@suse.de> Signed-off-by: Mike Snitzer <snitzer@redhat.com> Reviewed-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Diffstat (limited to 'drivers/md')
-rw-r--r--drivers/md/dm-mpath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index 422a9fdeb53e..c78e6a9e59ce 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -261,6 +261,9 @@ static void __pg_init_all_paths(struct multipath *m)
261 struct pgpath *pgpath; 261 struct pgpath *pgpath;
262 unsigned long pg_init_delay = 0; 262 unsigned long pg_init_delay = 0;
263 263
264 if (m->pg_init_in_progress || m->pg_init_disabled)
265 return;
266
264 m->pg_init_count++; 267 m->pg_init_count++;
265 m->pg_init_required = 0; 268 m->pg_init_required = 0;
266 if (m->pg_init_delay_retry) 269 if (m->pg_init_delay_retry)
@@ -501,8 +504,7 @@ static void process_queued_ios(struct work_struct *work)
501 (!pgpath && !m->queue_if_no_path)) 504 (!pgpath && !m->queue_if_no_path))
502 must_queue = 0; 505 must_queue = 0;
503 506
504 if (m->pg_init_required && !m->pg_init_in_progress && pgpath && 507 if (pgpath && m->pg_init_required)
505 !m->pg_init_disabled)
506 __pg_init_all_paths(m); 508 __pg_init_all_paths(m);
507 509
508 spin_unlock_irqrestore(&m->lock, flags); 510 spin_unlock_irqrestore(&m->lock, flags);