diff options
author | Ed Cashin <ecashin@coraid.com> | 2012-10-04 20:16:44 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-10-05 14:05:29 -0400 |
commit | 7159e969d1963f19e7550aafd234b0c5361e5d69 (patch) | |
tree | f6603c9341960d5344e6ddb3afac6a23e9fde635 /drivers/block/aoe | |
parent | 4bcce1a355c8248fb5661cb78bb14b9e19475cd4 (diff) |
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')
-rw-r--r-- | drivers/block/aoe/aoe.h | 2 | ||||
-rw-r--r-- | drivers/block/aoe/aoecmd.c | 17 |
2 files changed, 11 insertions, 8 deletions
diff --git a/drivers/block/aoe/aoe.h b/drivers/block/aoe/aoe.h index 7b694f7da2de..4ae2468b4a06 100644 --- a/drivers/block/aoe/aoe.h +++ b/drivers/block/aoe/aoe.h | |||
@@ -49,8 +49,6 @@ struct aoe_hdr { | |||
49 | __be32 tag; | 49 | __be32 tag; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define AOE_MAXSHELF (0xffff-1) /* one less than the broadcast shelf address */ | ||
53 | |||
54 | struct aoe_atahdr { | 52 | struct aoe_atahdr { |
55 | unsigned char aflags; | 53 | unsigned char aflags; |
56 | unsigned char errfeat; | 54 | unsigned char errfeat; |
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index 94e810c36de1..3804a0af3ef1 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -1349,15 +1349,14 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1349 | "Check shelf dip switches.\n"); | 1349 | "Check shelf dip switches.\n"); |
1350 | return; | 1350 | return; |
1351 | } | 1351 | } |
1352 | if (aoemajor > AOE_MAXSHELF) { | 1352 | if (aoemajor == 0xffff) { |
1353 | pr_info("aoe: e%ld.%d: shelf number too large\n", | 1353 | pr_info("aoe: e%ld.%d: broadcast shelf number invalid\n", |
1354 | aoemajor, (int) h->minor); | 1354 | aoemajor, (int) h->minor); |
1355 | return; | 1355 | return; |
1356 | } | 1356 | } |
1357 | 1357 | if (h->minor == 0xff) { | |
1358 | d = aoedev_by_aoeaddr(aoemajor, h->minor, 1); | 1358 | pr_info("aoe: e%ld.%d: broadcast slot number invalid\n", |
1359 | if (d == NULL) { | 1359 | aoemajor, (int) h->minor); |
1360 | pr_info("aoe: device allocation failure\n"); | ||
1361 | return; | 1360 | return; |
1362 | } | 1361 | } |
1363 | 1362 | ||
@@ -1365,6 +1364,12 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1365 | if (n > aoe_maxout) /* keep it reasonable */ | 1364 | if (n > aoe_maxout) /* keep it reasonable */ |
1366 | n = aoe_maxout; | 1365 | n = aoe_maxout; |
1367 | 1366 | ||
1367 | d = aoedev_by_aoeaddr(aoemajor, h->minor, 1); | ||
1368 | if (d == NULL) { | ||
1369 | pr_info("aoe: device allocation failure\n"); | ||
1370 | return; | ||
1371 | } | ||
1372 | |||
1368 | spin_lock_irqsave(&d->lock, flags); | 1373 | spin_lock_irqsave(&d->lock, flags); |
1369 | 1374 | ||
1370 | t = gettgt(d, h->src); | 1375 | t = gettgt(d, h->src); |