dm mpath: fail message ioctl if specified path is not valid
authorMike Snitzer <snitzer@redhat.com>
Thu, 24 Mar 2011 13:54:31 +0000 (13:54 +0000)
committerAlasdair G Kergon <agk@redhat.com>
Thu, 24 Mar 2011 13:54:31 +0000 (13:54 +0000)
commit19040c0bc8efcb767221d8ef7bb9c32ff0586179
tree49df397ce008ecc7f2e19caadb86c1c7c7fbcbf3
parentf868120549fc1664b2c451d4b9882a363928c698
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>
drivers/md/dm-mpath.c