diff options
Diffstat (limited to 'drivers/md/dm-mpath.c')
-rw-r--r-- | drivers/md/dm-mpath.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index d8abb90a6c2f..034233eefc82 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -1555,6 +1555,7 @@ static int multipath_ioctl(struct dm_target *ti, unsigned int cmd, | |||
1555 | unsigned long arg) | 1555 | unsigned long arg) |
1556 | { | 1556 | { |
1557 | struct multipath *m = ti->private; | 1557 | struct multipath *m = ti->private; |
1558 | struct pgpath *pgpath; | ||
1558 | struct block_device *bdev; | 1559 | struct block_device *bdev; |
1559 | fmode_t mode; | 1560 | fmode_t mode; |
1560 | unsigned long flags; | 1561 | unsigned long flags; |
@@ -1570,12 +1571,14 @@ again: | |||
1570 | if (!m->current_pgpath) | 1571 | if (!m->current_pgpath) |
1571 | __choose_pgpath(m, 0); | 1572 | __choose_pgpath(m, 0); |
1572 | 1573 | ||
1573 | if (m->current_pgpath) { | 1574 | pgpath = m->current_pgpath; |
1574 | bdev = m->current_pgpath->path.dev->bdev; | 1575 | |
1575 | mode = m->current_pgpath->path.dev->mode; | 1576 | if (pgpath) { |
1577 | bdev = pgpath->path.dev->bdev; | ||
1578 | mode = pgpath->path.dev->mode; | ||
1576 | } | 1579 | } |
1577 | 1580 | ||
1578 | if (m->queue_io) | 1581 | if ((pgpath && m->queue_io) || (!pgpath && m->queue_if_no_path)) |
1579 | r = -EAGAIN; | 1582 | r = -EAGAIN; |
1580 | else if (!bdev) | 1583 | else if (!bdev) |
1581 | r = -EIO; | 1584 | r = -EIO; |