[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]
[dm-devel] [PATCH 3/3] dm-ioctl: Don't allow multiple device specifiers
- From: Mikulas Patocka <mpatocka redhat com>
- To: "Alasdair G. Kergon" <agk redhat com>, dm-devel redhat com
- Subject: [dm-devel] [PATCH 3/3] dm-ioctl: Don't allow multiple device specifiers
- Date: Fri, 1 Jul 2011 15:05:48 -0400 (EDT)
dm-ioctl: Don't allow multiple device specifiers
Exactly one of name, uuid, device has to be specified.
Signed-off-by: Mikulas Patocka <mpatocka redhat com>
---
drivers/md/dm-ioctl.c | 6 ++++++
1 file changed, 6 insertions(+)
Index: linux-2.6.39-fast/drivers/md/dm-ioctl.c
===================================================================
--- linux-2.6.39-fast.orig/drivers/md/dm-ioctl.c 2011-07-01 19:52:31.000000000 +0200
+++ linux-2.6.39-fast/drivers/md/dm-ioctl.c 2011-07-01 19:53:04.000000000 +0200
@@ -739,10 +739,16 @@ static struct hash_cell *__find_device_h
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;
[Date Prev][Date Next] [Thread Prev][Thread Next]
[Thread Index]
[Date Index]
[Author Index]