]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
Exactly one of name, uuid or device must be specified when referencing
authorMikulas Patocka <mpatocka@redhat.com>
Mon, 25 Jul 2011 00:49:57 +0000 (10:49 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 25 Jul 2011 00:49:57 +0000 (10:49 +1000)
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 <mpatocka@redhat.com>
Signed-off-by: Alasdair G Kergon <agk@redhat.com>
drivers/md/dm-ioctl.c

index 52090a176ddb38c724b27794f98070a6076c5a34..03f8af5d244af3dbf7b6736bce92abc89c548b91 100644 (file)
@@ -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;