Re: [PATCH] fix scsi add-single-device

James Bottomley
2003-01-27T16:07:45Z

On Mon, 2003-01-27 at 02:15, Mike Anderson wrote:
> 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.

Yes, sorry (long week last week). It is indeed the semantics of
scsi_find_device() that are broken.

Thanks,

James