diff options
author | Mike Snitzer <snitzer@redhat.com> | 2011-03-24 09:54:31 -0400 |
---|---|---|
committer | Alasdair G Kergon <agk@redhat.com> | 2011-03-24 09:54:31 -0400 |
commit | 19040c0bc8efcb767221d8ef7bb9c32ff0586179 (patch) | |
tree | 49df397ce008ecc7f2e19caadb86c1c7c7fbcbf3 /drivers/md | |
parent | f868120549fc1664b2c451d4b9882a363928c698 (diff) |
dm mpath: fail message ioctl if specified path is not valid
Fail the reinstate_path and fail_path message ioctl if the specified
path is not valid.
The message ioctl would succeed for the 'reinistate_path' and
'fail_path' messages even if action was not taken because the
specified device was not a valid path of the multipath device.
Before, when /dev/vdb is not a path of mpathb:
$ dmsetup message mpathb 0 reinstate_path /dev/vdb
$ echo $?
0
After:
$ dmsetup message mpathb 0 reinstate_path /dev/vdb
device-mapper: message ioctl failed: Invalid argument
Command failed
$ echo $?
1
Signed-off-by: Mike Snitzer <snitzer@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
Diffstat (limited to 'drivers/md')
-rw-r--r-- | drivers/md/dm-mpath.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c index 4b0b63c290a6..52f0de394632 100644 --- a/drivers/md/dm-mpath.c +++ b/drivers/md/dm-mpath.c | |||
@@ -1065,7 +1065,7 @@ out: | |||
1065 | static int action_dev(struct multipath *m, struct dm_dev *dev, | 1065 | static int action_dev(struct multipath *m, struct dm_dev *dev, |
1066 | action_fn action) | 1066 | action_fn action) |
1067 | { | 1067 | { |
1068 | int r = 0; | 1068 | int r = -EINVAL; |
1069 | struct pgpath *pgpath; | 1069 | struct pgpath *pgpath; |
1070 | struct priority_group *pg; | 1070 | struct priority_group *pg; |
1071 | 1071 | ||
@@ -1669,7 +1669,7 @@ out: | |||
1669 | *---------------------------------------------------------------*/ | 1669 | *---------------------------------------------------------------*/ |
1670 | static struct target_type multipath_target = { | 1670 | static struct target_type multipath_target = { |
1671 | .name = "multipath", | 1671 | .name = "multipath", |
1672 | .version = {1, 2, 0}, | 1672 | .version = {1, 3, 0}, |
1673 | .module = THIS_MODULE, | 1673 | .module = THIS_MODULE, |
1674 | .ctr = multipath_ctr, | 1674 | .ctr = multipath_ctr, |
1675 | .dtr = multipath_dtr, | 1675 | .dtr = multipath_dtr, |