diff options
author | Hannes Reinecke <hare@suse.de> | 2014-02-28 14:33:49 (GMT) |
---|---|---|
committer | Mike Snitzer <snitzer@redhat.com> | 2014-03-27 20:56:25 (GMT) |
commit | 3a0175096423856d145e210527271c9eec188a5f (patch) | |
tree | 01ef8a823a28a27f9c82e3b167e2963097fc47d6 | |
parent | 9bf59a611a5eb479f321fae34adc9f948de0a42f (diff) | |
download | linux-3a0175096423856d145e210527271c9eec188a5f.tar.xz |
dm-mpath: do not activate failed paths
activate_path() is run without a lock, so the path might be
set to failed before activate_path() had a chance to run.
This patch add a check for ->active in activate_path() to
avoid unnecessary overhead by calling functions which are known
to be failing.
Signed-off-by: Hannes Reinecke <hare@suse.de>
Reviewed-by: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
-rw-r--r-- | drivers/md/dm-mpath.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index e7d80ba..b1fb01e 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -1195,8 +1195,11 @@ static void activate_path(struct work_struct *work) struct pgpath *pgpath = container_of(work, struct pgpath, activate_path.work); - scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev), - pg_init_done, pgpath); + if (pgpath->is_active) + scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev), + pg_init_done, pgpath); + else + pg_init_done(pgpath, SCSI_DH_DEV_OFFLINED); } static int noretry_error(int error) |