Skip to content

Commit 17f4ff4

Browse files
hreineckesnitm
authored andcommitted
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>
1 parent 9cdb852 commit 17f4ff4

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎drivers/md/dm-mpath.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,9 @@ static void __pg_init_all_paths(struct multipath *m)
261261
struct pgpath *pgpath;
262262
unsigned long pg_init_delay = 0;
263263

264+
if (m->pg_init_in_progress || m->pg_init_disabled)
265+
return;
266+
264267
m->pg_init_count++;
265268
m->pg_init_required = 0;
266269
if (m->pg_init_delay_retry)
@@ -501,8 +504,7 @@ static void process_queued_ios(struct work_struct *work)
501504
(!pgpath && !m->queue_if_no_path))
502505
must_queue = 0;
503506

504-
if (m->pg_init_required && !m->pg_init_in_progress && pgpath &&
505-
!m->pg_init_disabled)
507+
if (pgpath && m->pg_init_required)
506508
__pg_init_all_paths(m);
507509

508510
spin_unlock_irqrestore(&m->lock, flags);

0 commit comments

Comments
 (0)