mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] aoe: ensure that AoE minor address is supported
@ 2009-08-07 13:05 Ed Cashin
  0 siblings, 0 replies; only message in thread
From: Ed Cashin @ 2009-08-07 13:05 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ed Cashin

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>
---

I plan to put this patch in the aoe quilt tree for linux-next.

 drivers/block/aoe/aoecmd.c |    8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index 965ece2..437b95b 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;
 	}
-- 
1.5.6.5


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-08-07 13:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-08-07 13:05 [PATCH] aoe: ensure that AoE minor address is supported Ed Cashin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®