From: Mikulas Patocka Date: Mon, 25 Jul 2011 00:49:57 +0000 (+1000) Subject: Exactly one of name, uuid or device must be specified when referencing X-Git-Tag: next-20110726~30^2~14 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=88764c12f00f673a18e426e05ece293f38167022;p=karo-tx-linux.git Exactly one of name, uuid or device must be specified when referencing an existing device. This removes the ambiguity (risking the wrong device being updated) if two conflicting parameters were specified. Previously one parameter got used and any others were ignored silently. Signed-off-by: Mikulas Patocka Signed-off-by: Alasdair G Kergon --- diff --git a/drivers/md/dm-ioctl.c b/drivers/md/dm-ioctl.c index 52090a176ddb..03f8af5d244a 100644 --- a/drivers/md/dm-ioctl.c +++ b/drivers/md/dm-ioctl.c @@ -739,10 +739,16 @@ static struct hash_cell *__find_device_hash_cell(struct dm_ioctl *param) struct hash_cell *hc = NULL; if (*param->uuid) { + if (*param->name || param->dev) + return NULL; + hc = __get_uuid_cell(param->uuid); if (!hc) return NULL; } else if (*param->name) { + if (param->dev) + return NULL; + hc = __get_name_cell(param->name); if (!hc) return NULL;