Commit 3a017509 authored by Hannes Reinecke's avatar Hannes Reinecke Committed by Mike Snitzer

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: default avatarHannes Reinecke <hare@suse.de>
Reviewed-by: default avatarJun'ichi Nomura <j-nomura@ce.jp.nec.com>
Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
parent 9bf59a61
...@@ -1195,8 +1195,11 @@ static void activate_path(struct work_struct *work) ...@@ -1195,8 +1195,11 @@ static void activate_path(struct work_struct *work)
struct pgpath *pgpath = struct pgpath *pgpath =
container_of(work, struct pgpath, activate_path.work); container_of(work, struct pgpath, activate_path.work);
scsi_dh_activate(bdev_get_queue(pgpath->path.dev->bdev), if (pgpath->is_active)
pg_init_done, pgpath); 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) static int noretry_error(int error)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment