aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block
diff options
context:
space:
mode:
authorEd Cashin <ecashin@coraid.com>2012-10-04 20:16:32 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2012-10-05 14:05:26 -0400
commit6583303c5e324a918ee1d57201acd9869f3be6da (patch)
tree10e35ca5e16875475a7b721acd4a527a663a6647 /drivers/block
parent25f4d75ea45cdcc59158bfd1ae162a6ff2071124 (diff)
aoe: disallow unsupported AoE minor addresses
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> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/block')
-rw-r--r--drivers/block/aoe/aoecmd.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c
index e3291dfa7607..2a6a4316db00 100644
--- a/drivers/block/aoe/aoecmd.c
+++ b/drivers/block/aoe/aoecmd.c
@@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
1359 "Check shelf dip switches.\n"); 1359 "Check shelf dip switches.\n");
1360 return; 1360 return;
1361 } 1361 }
1362 if (h->minor >= NPERSHELF) {
1363 pr_err("aoe: e%ld.%d %s, %d\n",
1364 aoemajor, h->minor,
1365 "slot number larger than the maximum",
1366 NPERSHELF-1);
1367 return;
1368 }
1362 1369
1363 sysminor = SYSMINOR(aoemajor, h->minor); 1370 sysminor = SYSMINOR(aoemajor, h->minor);
1364 if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { 1371 if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {