diff options
author | Ed L. Cashin <ecashin@coraid.com> | 2008-02-08 07:20:09 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 12:22:32 -0500 |
commit | 578c4aa0b455a1850208ccc67ca1ca23697e72f5 (patch) | |
tree | 5f5fc92ff4b7ab066191d4c3c2a7f25adaf1a9e9 /drivers/block/aoe | |
parent | 1d75981a8094e9f84fae65a6a83b361e3893b971 (diff) |
aoe: make error messages more specific
Andrew Morton pointed out that the "too many targets" message in patch 2 could
be printed for failing GFP_ATOMIC allocations. This patch makes the messages
more specific.
Signed-off-by: Ed L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.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/aoecmd.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/block/aoe/aoecmd.c b/drivers/block/aoe/aoecmd.c index bcea36c87d04..1e37cf6d9214 100644 --- a/drivers/block/aoe/aoecmd.c +++ b/drivers/block/aoe/aoecmd.c | |||
@@ -957,15 +957,17 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) | |||
957 | for (; tt < te && *tt; tt++) | 957 | for (; tt < te && *tt; tt++) |
958 | ; | 958 | ; |
959 | 959 | ||
960 | if (tt == te) | 960 | if (tt == te) { |
961 | printk(KERN_INFO | ||
962 | "aoe: device addtgt failure; too many targets\n"); | ||
961 | return NULL; | 963 | return NULL; |
962 | 964 | } | |
963 | t = kcalloc(1, sizeof *t, GFP_ATOMIC); | 965 | t = kcalloc(1, sizeof *t, GFP_ATOMIC); |
964 | if (!t) | ||
965 | return NULL; | ||
966 | f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); | 966 | f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); |
967 | if (!f) { | 967 | if (!t || !f) { |
968 | kfree(f); | ||
968 | kfree(t); | 969 | kfree(t); |
970 | printk(KERN_INFO "aoe: cannot allocate memory to add target\n"); | ||
969 | return NULL; | 971 | return NULL; |
970 | } | 972 | } |
971 | 973 | ||
@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb) | |||
1029 | if (!t) { | 1031 | if (!t) { |
1030 | t = addtgt(d, h->src, n); | 1032 | t = addtgt(d, h->src, n); |
1031 | if (!t) { | 1033 | if (!t) { |
1032 | printk(KERN_INFO | ||
1033 | "aoe: device addtgt failure; " | ||
1034 | "too many targets?\n"); | ||
1035 | spin_unlock_irqrestore(&d->lock, flags); | 1034 | spin_unlock_irqrestore(&d->lock, flags); |
1036 | return; | 1035 | return; |
1037 | } | 1036 | } |