]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
aoe: disallow unsupported AoE minor addresses
authorEd Cashin <ecashin@coraid.com>
Fri, 7 Sep 2012 00:25:11 +0000 (10:25 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Mon, 10 Sep 2012 06:18:28 +0000 (16:18 +1000)
A guard is inserted to prevent AoE minor addresses (slot addresses) higher
than 15 to be used, as they are not yet supported by the driver.

There is a change coming that will allow the aoe driver to overcome this
limit by using system device minor numbers dynamically, but until then,
this guard prevents unexpected targets from being used by the driver when
AoE targets with high minor numbers are on the AoE network.

Signed-off-by: Ed Cashin <ecashin@coraid.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
drivers/block/aoe/aoecmd.c

index 7f9cc44c92744a4c99551768bf3bae63474fd0e1..61cc1cfcded485c1027ca95f584bf84fa3261b64 100644 (file)
@@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
                        "Check shelf dip switches.\n");
                return;
        }
+       if (h->minor >= NPERSHELF) {
+               pr_err("aoe: e%ld.%d %s, %d\n",
+                       aoemajor, h->minor,
+                       "slot number larger than the maximum",
+                       NPERSHELF-1);
+               return;
+       }
 
        sysminor = SYSMINOR(aoemajor, h->minor);
        if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {