public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Kyle McMartin <kyle@infradead.org>, linux-scsi@vger.kernel.org
Subject: Re: iscsi_add_session() warning
Date: Wed, 04 Feb 2009 01:40:11 -0600	[thread overview]
Message-ID: <4989465B.9060109@cs.wisc.edu> (raw)
In-Reply-To: <20090203162224.7c80d962.akpm@linux-foundation.org>

Andrew Morton wrote:
> On Tue, 3 Feb 2009 19:12:38 -0500
> Kyle McMartin <kyle@infradead.org> wrote:
> 
>> On Tue, Feb 03, 2009 at 04:09:00PM -0800, Andrew Morton wrote:
>>> : 	if (id == ISCSI_MAX_TARGET) {
>>> : 		for (id = 0; id < ISCSI_MAX_TARGET; id++) {
>>> : 			err = device_for_each_child(&shost->shost_gendev, &id,
>> Possibly GCC just can't figure out that id was reinitialized, so it
>> thinks that the for loop won't be executed?
>>
> 
> Could be.  But that isn't the point...
> 
> The point, dear Kyle, is that I misread the code :(
> 
> In fact on that codepath the function _will_ return the most recent
> return value from device_for_each_child(iscsi_get_next_target_id), and
> that value will be non-zero (-EEXIST).  So it looks non-buggy, albeit
> rather obscure.
> 
> But did we intend to return -EEXIST in the "Too many iscsi targets" case?

I did not. The callers just check for non zero so it will work. It would 
be best to change it to something meaningful.

When there are no ids for some object left, what is the stadard Exxxx 
value to return? Would ENOSPC make sense? Here ENOSPC would mean no 
space in id space left instead of space on a device?

  reply	other threads:[~2009-02-04  7:40 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-04  0:09 iscsi_add_session() warning Andrew Morton
2009-02-04  0:12 ` Kyle McMartin
2009-02-04  0:22   ` Andrew Morton
2009-02-04  7:40     ` Mike Christie [this message]
2009-02-04  7:50       ` Andrew Morton
2009-02-04 17:56   ` Grant Grundler

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=4989465B.9060109@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=akpm@linux-foundation.org \
    --cc=kyle@infradead.org \
    --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