Linux Device Mapper development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: dm-devel@redhat.com
Cc: Mike Snitzer <snitzer@redhat.com>
Subject: [PATCH 1/2] dm mpath: fail message ioctl if specified path is not valid
Date: Mon, 31 Jan 2011 11:14:17 -0500	[thread overview]
Message-ID: <1296490458-12910-1-git-send-email-snitzer@redhat.com> (raw)

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:
$ 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>
---
 drivers/md/dm-mpath.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index b82d288..97842c6 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -1065,7 +1065,7 @@ out:
 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;
 
-- 
1.7.3.4

             reply	other threads:[~2011-01-31 16:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-31 16:14 Mike Snitzer [this message]
2011-01-31 16:14 ` [PATCH 2/2] dm mpath: allow table load with 0 priority groups Mike Snitzer
2011-01-31 18:09   ` Moger, Babu
2011-01-31 18:34     ` [RFC PATCH] multipathd: use 0 for initial pg if nr_priority_groups=0 (was: Re: [PATCH 2/2] dm mpath: allow table load with 0 priority groups) Mike Snitzer
2011-02-01 15:38       ` [RFC PATCH] multipathd: use 0 for initial pg if nr_priority_groups=0 Hannes Reinecke
2011-02-10 22:00         ` Mike Snitzer
2011-02-11 15:44           ` Hannes Reinecke
2011-02-01 15:40   ` [PATCH 2/2] dm mpath: allow table load with 0 priority groups Hannes Reinecke
2011-02-10 21:06   ` [PATCH 2/2 v2] " Mike Snitzer
2011-02-10 21:13     ` Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1296490458-12910-1-git-send-email-snitzer@redhat.com \
    --to=snitzer@redhat.com \
    --cc=dm-devel@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox