public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Kyle McMartin <kyle@infradead.org>
Cc: michaelc@cs.wisc.edu, linux-scsi@vger.kernel.org
Subject: Re: iscsi_add_session() warning
Date: Tue, 3 Feb 2009 16:22:24 -0800	[thread overview]
Message-ID: <20090203162224.7c80d962.akpm@linux-foundation.org> (raw)
In-Reply-To: <20090204001238.GG19327@bombadil.infradead.org>

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?

  reply	other threads:[~2009-02-04  0:22 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 [this message]
2009-02-04  7:40     ` Mike Christie
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=20090203162224.7c80d962.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=kyle@infradead.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=michaelc@cs.wisc.edu \
    /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