Commit fc458dcd authored by ecashin@coraid.com's avatar ecashin@coraid.com Committed by Greg KH

[PATCH] aoe 1/12: remove too-low cap on minor number

remove too-low cap on minor number
Signed-off-by: default avatarEd L. Cashin <ecashin@coraid.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c0698f2f
...@@ -2,9 +2,14 @@ ...@@ -2,9 +2,14 @@
#define VERSION "5" #define VERSION "5"
#define AOE_MAJOR 152 #define AOE_MAJOR 152
#define DEVICE_NAME "aoe" #define DEVICE_NAME "aoe"
/* set AOE_PARTITIONS to 1 to use whole-disks only
* default is 16, which is 15 partitions plus the whole disk
*/
#ifndef AOE_PARTITIONS #ifndef AOE_PARTITIONS
#define AOE_PARTITIONS 16 #define AOE_PARTITIONS 16
#endif #endif
#define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor)) #define SYSMINOR(aoemajor, aoeminor) ((aoemajor) * 10 + (aoeminor))
#define AOEMAJOR(sysminor) ((sysminor) / 10) #define AOEMAJOR(sysminor) ((sysminor) / 10)
#define AOEMINOR(sysminor) ((sysminor) % 10) #define AOEMINOR(sysminor) ((sysminor) % 10)
......
...@@ -577,7 +577,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -577,7 +577,7 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
struct aoe_cfghdr *ch; struct aoe_cfghdr *ch;
ulong flags, bufcnt, sysminor, aoemajor; ulong flags, bufcnt, sysminor, aoemajor;
struct sk_buff *sl; struct sk_buff *sl;
enum { MAXFRAMES = 8, MAXSYSMINOR = 255 }; enum { MAXFRAMES = 8 };
h = (struct aoe_hdr *) skb->mac.raw; h = (struct aoe_hdr *) skb->mac.raw;
ch = (struct aoe_cfghdr *) (h+1); ch = (struct aoe_cfghdr *) (h+1);
...@@ -594,9 +594,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -594,9 +594,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
} }
sysminor = SYSMINOR(aoemajor, h->minor); sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor > MAXSYSMINOR) { if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
printk(KERN_INFO "aoe: aoecmd_cfg_rsp: sysminor %ld too " printk(KERN_INFO
"large\n", sysminor); "aoe: e%ld.%d: minor number too large\n",
aoemajor, (int) h->minor);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment