Commit 578c4aa0 authored by Ed L. Cashin's avatar Ed L. Cashin Committed by Linus Torvalds

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: default avatarEd L. Cashin <ecashin@coraid.com>
Cc: Greg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 1d75981a
...@@ -957,15 +957,17 @@ addtgt(struct aoedev *d, char *addr, ulong nframes) ...@@ -957,15 +957,17 @@ addtgt(struct aoedev *d, char *addr, ulong nframes)
for (; tt < te && *tt; tt++) for (; tt < te && *tt; tt++)
; ;
if (tt == te) if (tt == te) {
printk(KERN_INFO
"aoe: device addtgt failure; too many targets\n");
return NULL; return NULL;
}
t = kcalloc(1, sizeof *t, GFP_ATOMIC); t = kcalloc(1, sizeof *t, GFP_ATOMIC);
if (!t)
return NULL;
f = kcalloc(nframes, sizeof *f, GFP_ATOMIC); f = kcalloc(nframes, sizeof *f, GFP_ATOMIC);
if (!f) { if (!t || !f) {
kfree(f);
kfree(t); kfree(t);
printk(KERN_INFO "aoe: cannot allocate memory to add target\n");
return NULL; return NULL;
} }
...@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb) ...@@ -1029,9 +1031,6 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
if (!t) { if (!t) {
t = addtgt(d, h->src, n); t = addtgt(d, h->src, n);
if (!t) { if (!t) {
printk(KERN_INFO
"aoe: device addtgt failure; "
"too many targets?\n");
spin_unlock_irqrestore(&d->lock, flags); spin_unlock_irqrestore(&d->lock, flags);
return; return;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment