summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2009-07-21 16:33:49 -0400
committerStephen Rothwell <sfr@canb.auug.org.au>2009-09-11 09:05:25 +1000
commitc3643395dc3b8d47932e2bbc2992532ae88ee522 (patch)
tree155338596beff2b040ca9888aafc82bad34e4327
parente07cccf4046978df10f2e13fe2b99b2f9b3a65db (diff)
aoe: ensure that AoE minor address is supported
This aoe driver only supports a fixed number of AoE minor ("slot") addresses per major ("shelf") address. This check ensures that the minor address is supported and clarifies the diagnostic message. Signed-off-by: Ed Cashin <ecashin@coraid.com>
-rw-r--r--drivers/block/aoe/aoecmd.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 965ece2c7e4d..437b95b15829 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -982,8 +982,12 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
}
sysminor = SYSMINOR(aoemajor, h->minor);
- if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
- printk(KERN_INFO "aoe: e%ld.%d: minor number too large\n",
+ if (h->minor >= NPERSHELF) {
+ printk(KERN_INFO "aoe: e%ld.%d: AoE minor address too large\n",
+ aoemajor, (int) h->minor);
+ return;
+ } else if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
+ printk(KERN_INFO "aoe: e%ld.%d: AoE major address too large\n",
aoemajor, (int) h->minor);
return;
}