]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
aoe: disallow unsupported AoE minor addresses
authorEd Cashin <ecashin@coraid.com>
Fri, 21 Sep 2012 01:03:33 +0000 (11:03 +1000)
committerStephen Rothwell <sfr@canb.auug.org.au>
Fri, 21 Sep 2012 05:59:29 +0000 (15:59 +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 af2e3479b884dbdb41e4a061941211bf55a5ca4b..9fe5e9170d90bf5898164bfe5d54a52a3639a799 100644 (file)
@@ -1358,6 +1358,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) {