lkml.org 
[lkml]   [2007]   [Dec]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 12/13] make error messages more specific
Date
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>
---
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 bcea36c..1e37cf6 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)
for (; tt < te && *tt; tt++)
;

- if (tt == te)
+ if (tt == te) {
+ printk(KERN_INFO
+ "aoe: device addtgt failure; too many targets\n");
return NULL;
-
+ }
t = kcalloc(1, sizeof *t, GFP_ATOMIC);
- if (!t)
- return NULL;
f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
- if (!f) {
+ if (!t || !f) {
+ kfree(f);
kfree(t);
+ printk(KERN_INFO "aoe: cannot allocate memory to add target\n");
return NULL;
}

@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
if (!t) {
t = addtgt(d, h->src, n);
if (!t) {
- printk(KERN_INFO
- "aoe: device addtgt failure; "
- "too many targets?\n");
spin_unlock_irqrestore(&d->lock, flags);
return;
}
--
1.5.3.4


\
 
 \ /
  Last update: 2007-12-20 23:25    [W:0.141 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site