From: "Nicholas A. Bellinger" <nab@linux-iscsi.org>
To: Rolf Eike Beer <eike-kernel@sf-tec.de>
Cc: James Bottomley <James.Bottomley@suse.de>,
linux-scsi <linux-scsi@vger.kernel.org>
Subject: Re: target: Fix excessive stack usage
Date: Fri, 07 Jan 2011 12:55:30 -0800 [thread overview]
Message-ID: <1294433730.2895.135.camel@haakon2.linux-iscsi.org> (raw)
In-Reply-To: <201101071732.27612.eike-kernel@sf-tec.de>
On Fri, 2011-01-07 at 17:32 +0100, Rolf Eike Beer wrote:
> James Bottomley wrote:
>
> > @@ -1870,6 +1870,10 @@ static int __core_scsi3_update_aptpl_buf(
> > "No Registrations or Reservations\n");
> > return 0;
> > }
> > + tmp = kmalloc(1024, GFP_KERNEL);
> > + if (!tmp)
> > + return -1;
>
> Shouldn't this return useful errorcodes all over the place instead of just -1?
> Like -ENOMEM?
>
Hi Eike,
So I ended up dropping this allocation from James' original patch in
favour of shrinking the local stack usage for tmp from 1024 to 512 bytes
in order to avoid the extra kmalloc() here..
However there are still a number of cases in target_core_pr.c code where
we 'return -1' to signal a failure. This was originally because these
failures never get propagated to any code that makes sense of errno, and
all of the conditional checks are looking for a non zero return.
So IMHO changing this does not provide much benefit, but I would still
accept a patch if you are interested. ;)
Best,
--nab
prev parent reply other threads:[~2011-01-07 21:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-05 0:29 target: Fix excessive stack usage James Bottomley
2011-01-05 22:23 ` Nicholas A. Bellinger
2011-01-07 16:32 ` Rolf Eike Beer
2011-01-07 20:55 ` Nicholas A. Bellinger [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1294433730.2895.135.camel@haakon2.linux-iscsi.org \
--to=nab@linux-iscsi.org \
--cc=James.Bottomley@suse.de \
--cc=eike-kernel@sf-tec.de \
--cc=linux-scsi@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).