diff options
author | Ed Cashin <ecashin@coraid.com> | 2012-10-04 17:16:44 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-06 03:05:29 +0900 |
commit | 7159e969d1963f19e7550aafd234b0c5361e5d69 (patch) | |
tree | f6603c9341960d5344e6ddb3afac6a23e9fde635 /drivers/block/aoe/aoecmd.c | |
parent | 4bcce1a355c8248fb5661cb78bb14b9e19475cd4 (diff) | |
download | op-kernel-dev-7159e969d1963f19e7550aafd234b0c5361e5d69.zip op-kernel-dev-7159e969d1963f19e7550aafd234b0c5361e5d69.tar.gz |
aoe: update and specify AoE address guards and error messages
In general, specific is better when it comes to messages about AoE usage
problems. Also, explicit checks for the AoE broadcast addresses are
added.
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/aoe/aoecmd.c')
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 94e810c..3804a0a 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c @@ -1349,15 +1349,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb) "Check shelf dip switches.\n"); return; } - if (aoemajor > AOE_MAXSHELF) { - pr_info("aoe: e%ld.%d: shelf number too large\n", + if (aoemajor == 0xffff) { + pr_info("aoe: e%ld.%d: broadcast shelf number invalid\n", aoemajor, (int) h->minor); return; } - - d = aoedev_by_aoeaddr(aoemajor, h->minor, 1); - if (d == NULL) { - pr_info("aoe: device allocation failure\n"); + if (h->minor == 0xff) { + pr_info("aoe: e%ld.%d: broadcast slot number invalid\n", + aoemajor, (int) h->minor); return; } @@ -1365,6 +1364,12 @@ aoecmd_cfg_rsp(struct sk_buff *skb) if (n > aoe_maxout) /* keep it reasonable */ n = aoe_maxout; + d = aoedev_by_aoeaddr(aoemajor, h->minor, 1); + if (d == NULL) { + pr_info("aoe: device allocation failure\n"); + return; + } + spin_lock_irqsave(&d->lock, flags); t = gettgt(d, h->src); |