Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dm mpath: return parameter error

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>

authored by

Mikulas Patocka and committed by
Alasdair G Kergon
148acff6 6ae2fa67

+3 -1
+3 -1
drivers/md/dm-mpath.c
··· 625 625 struct pgpath *pgpath; 626 626 struct arg_set path_args; 627 627 628 - if (as->argc < nr_params) 628 + if (as->argc < nr_params) { 629 + ti->error = "not enough path parameters"; 629 630 goto bad; 631 + } 630 632 631 633 path_args.argc = nr_params; 632 634 path_args.argv = as->argv;