Skip to content

Commit

Permalink
dm mpath: return parameter error
Browse files Browse the repository at this point in the history
Return a specific error message if there are an invalid number of multipath
arguments.

This invalid command returns an "Unknown error" because the ti->error field is
not set

dmsetup create --table '0 2 multipath 0 0 1 1 round-robin 0 1 1 /dev/sdh' mpath0

Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
  • Loading branch information
Mikulas Patocka authored and Alasdair G Kergon committed Jul 21, 2008
1 parent 6ae2fa6 commit 148acff
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion drivers/md/dm-mpath.c
Original file line number Diff line number Diff line change
Expand Up @@ -625,8 +625,10 @@ static struct priority_group *parse_priority_group(struct arg_set *as,
struct pgpath *pgpath;
struct arg_set path_args;

if (as->argc < nr_params)
if (as->argc < nr_params) {
ti->error = "not enough path parameters";
goto bad;
}

path_args.argc = nr_params;
path_args.argv = as->argv;
Expand Down

0 comments on commit 148acff

Please sign in to comment.