提交 6583303c 编写于 作者: E Ed Cashin 提交者: Linus Torvalds

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: NEd Cashin <ecashin@coraid.com>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 25f4d75e
...@@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -1359,6 +1359,13 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
"Check shelf dip switches.\n"); "Check shelf dip switches.\n");
return; 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); sysminor = SYSMINOR(aoemajor, h->minor);
if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) { if (sysminor * AOE_PARTITIONS + AOE_PARTITIONS > MINORMASK) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册