diff options
-rw-r--r-- | drivers/block/aoe/aoe.h | 5 | ||||
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index db78f826d40c..551dd8e5b14b 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -2,9 +2,14 @@ | |||
2 | #define VERSION "5" | 2 | #define VERSION "5" |
3 | #define AOE_MAJOR 152 | 3 | #define AOE_MAJOR 152 |
4 | #define DEVICE_NAME "aoe" | 4 | #define DEVICE_NAME "aoe" |
5 | |||
6 | /* set AOE_PARTITIONS to 1 to use whole-disks only | ||
7 | * default is 16, which is 15 partitions plus the whole disk | ||
8 | */ | ||
5 | #ifndef AOE_PARTITIONS | 9 | #ifndef AOE_PARTITIONS |
6 | #define AOE_PARTITIONS 16 | 10 | #define AOE_PARTITIONS 16 |
7 | #endif | 11 | #endif |
12 | |||
8 | #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor)) | 13 | #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor)) |
9 | #define AOEMAJOR(sysminor) ((sysminor) / 10) | 14 | #define AOEMAJOR(sysminor) ((sysminor) / 10) |
10 | #define AOEMINOR(sysminor) ((sysminor) % 10) | 15 | #define AOEMINOR(sysminor) ((sysminor) % 10) |
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index fb6d942a4565..1b711a52dd25 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -577,7 +577,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
577 | struct aoe_cfghdr *ch; | 577 | struct aoe_cfghdr *ch; |
578 | ulong flags, bufcnt, sysminor, aoemajor; | 578 | ulong flags, bufcnt, sysminor, aoemajor; |
579 | struct sk_buff *sl; | 579 | struct sk_buff *sl; |
580 | enum { MAXFRAMES = 8, MAXSYSMINOR = 255 }; | 580 | enum { MAXFRAMES = 8 }; |
581 | 581 | ||
582 | h = (struct aoe_hdr *) skb->mac.raw; | 582 | h = (struct aoe_hdr *) skb->mac.raw; |
583 | ch = (struct aoe_cfghdr *) (h+1); | 583 | ch = (struct aoe_cfghdr *) (h+1); |
@@ -594,9 +594,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
594 | } | 594 | } |
595 | 595 | ||
596 | sysminor = SYSMINOR(aoemajor, h->minor); | 596 | sysminor = SYSMINOR(aoemajor, h->minor); |
597 | if (sysminor > MAXSYSMINOR) { | 597 | if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { |
598 | printk(KERN_INFO "aoe: aoecmd_cfg_rsp: sysminor %ld too " | 598 | printk(KERN_INFO |
599 | "large\n", sysminor); | 599 | "aoe: e%ld.%d: minor number too large\n", |
600 | aoemajor, (int) h->minor); | ||
600 | return; | 601 | return; |
601 | } | 602 | } |
602 | 603 | ||