public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Mike Anderson <andmike@us.ibm.com>
To: James Bottomley <James.Bottomley@steeleye.com>
Cc: linux-scsi@vger.kernel.org
Subject: Re: [PATCH] fix scsi add-single-device
Date: Mon, 27 Jan 2003 00:15:35 -0800	[thread overview]
Message-ID: <20030127081535.GA7780@beaverton.ibm.com> (raw)
In-Reply-To: <1043604061.12324.59.camel@mulgrave>

James Bottomley [James.Bottomley@steeleye.com] wrote:
> diff -Nru a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> --- a/drivers/scsi/scsi_scan.c	Sun Jan 26 11:58:46 2003
> +++ b/drivers/scsi/scsi_scan.c	Sun Jan 26 11:58:46 2003
> @@ -1758,7 +1758,7 @@
>  	shost = scsi_host_hn_get(host);
>  	if (!shost)
>  		return -ENODEV;
> -	if(scsi_find_device(shost, channel, id, lun) != NULL)
> +	if(scsi_find_device(shost, channel, id, lun) == NULL)
>  		goto out;

The previous condition seemed to be correct as you want to exit if
scsi_find_device finds a scsi_device at the nexus you are trying to add.

The patch below fixed the interface for me.  Though I only tested in
with scsi_debug under UML YMMV.

-andmike
--
Michael Anderson
andmike@us.ibm.com

 hosts.h |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

------

--- 1.48/drivers/scsi/hosts.h	Fri Jan 10 13:13:38 2003
+++ edited/drivers/scsi/hosts.h	Mon Jan 27 00:02:23 2003
@@ -605,8 +605,8 @@
 	list_for_each_entry (sdev, &shost->my_devices, siblings)
                 if (sdev->channel == channel && sdev->id == pun
                    && sdev->lun ==lun)
-                        break;
-        return sdev;
+                        return sdev;
+        return NULL;
 }
 
 /*

  reply	other threads:[~2003-01-27  8:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-26 18:00 [PATCH] fix scsi add-single-device James Bottomley
2003-01-27  8:15 ` Mike Anderson [this message]
2003-01-27 16:07   ` James Bottomley

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=20030127081535.GA7780@beaverton.ibm.com \
    --to=andmike@us.ibm.com \
    --cc=James.Bottomley@steeleye.com \
    --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