Skip to content

Commit

Permalink
aoe: disallow unsupported AoE minor addresses
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
ecashin authored and torvalds committed Oct 5, 2012
1 parent 25f4d75 commit 6583303
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/block/aoe/aoecmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 6583303

Please sign in to comment.