From afb62dec818d8692aa270152888d5dca8da1d9c9 Mon Sep 17 00:00:00 2001 From: Mike Snitzer Date: Sun, 31 Jan 2016 17:59:33 -0500 Subject: [PATCH] dm mpath: reduce granularity of locking in __multipath_map No need to hold m->lock after path has been selected (and 'struct multipath' state updated). Signed-off-by: Mike Snitzer --- drivers/md/dm-mpath.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 798644624663..199d3d3aa546 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c @@ -427,18 +427,18 @@ static int __multipath_map(struct dm_target *ti, struct request *clone, goto out_unlock; } + spin_unlock_irq(&m->lock); + mpio = set_mpio(m, map_context); if (!mpio) /* ENOMEM, requeue */ - goto out_unlock; + return r; mpio->pgpath = pgpath; mpio->nr_bytes = nr_bytes; bdev = pgpath->path.dev->bdev; - spin_unlock_irq(&m->lock); - if (clone) { /* * Old request-based interface: allocated clone is passed in. -- 2.39.5