Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Hannes Reinecke and committed by
Mike Snitzer
17f4ff45 9cdb8520

+4 -2
+4 -2
drivers/md/dm-mpath.c
··· 261 261 struct pgpath *pgpath; 262 262 unsigned long pg_init_delay = 0; 263 263 264 + if (m->pg_init_in_progress || m->pg_init_disabled) 265 + return; 266 + 264 267 m->pg_init_count++; 265 268 m->pg_init_required = 0; 266 269 if (m->pg_init_delay_retry) ··· 504 501 (!pgpath && !m->queue_if_no_path)) 505 502 must_queue = 0; 506 503 507 - if (m->pg_init_required && !m->pg_init_in_progress && pgpath && 508 - !m->pg_init_disabled) 504 + if (pgpath && m->pg_init_required) 509 505 __pg_init_all_paths(m); 510 506 511 507 spin_unlock_irqrestore(&m->lock, flags);