OSDN Git Service

dm mpath: do not call pg_init when it is already running
authorHannes Reinecke <hare@suse.de>
Fri, 28 Feb 2014 14:33:42 +0000 (15:33 +0100)
committerMike Snitzer <snitzer@redhat.com>
Thu, 27 Mar 2014 20:56:24 +0000 (16:56 -0400)
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>
drivers/md/dm-mpath.c

index 422a9fd..c78e6a9 100644 (file)
@@ -261,6 +261,9 @@ static void __pg_init_all_paths(struct multipath *m)
        struct pgpath *pgpath;
        unsigned long pg_init_delay = 0;
 
+       if (m->pg_init_in_progress || m->pg_init_disabled)
+               return;
+
        m->pg_init_count++;
        m->pg_init_required = 0;
        if (m->pg_init_delay_retry)
@@ -501,8 +504,7 @@ static void process_queued_ios(struct work_struct *work)
            (!pgpath && !m->queue_if_no_path))
                must_queue = 0;
 
-       if (m->pg_init_required && !m->pg_init_in_progress && pgpath &&
-           !m->pg_init_disabled)
+       if (pgpath && m->pg_init_required)
                __pg_init_all_paths(m);
 
        spin_unlock_irqrestore(&m->lock, flags);