Skip to content

Commit

Permalink
dm mpath: fail message ioctl if specified path is not valid
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Mike Snitzer authored and Alasdair G Kergon committed Mar 24, 2011
1 parent f868120 commit 19040c0
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -1065,7 +1065,7 @@ static int reinstate_path(struct pgpath *pgpath)
static int action_dev(struct multipath *m, struct dm_dev *dev,
action_fn action)
{
int r = 0;
int r = -EINVAL;
struct pgpath *pgpath;
struct priority_group *pg;

Expand Down Expand Up @@ -1669,7 +1669,7 @@ static int multipath_busy(struct dm_target *ti)
*---------------------------------------------------------------*/
static struct target_type multipath_target = {
.name = "multipath",
.version = {1, 2, 0},
.version = {1, 3, 0},
.module = THIS_MODULE,
.ctr = multipath_ctr,
.dtr = multipath_dtr,
Expand Down

0 comments on commit 19040c0

Please sign in to comment.