[4613] in linux-scsi channel archive
Re: [PATCH] SCSI host numbering
daemon@ATHENA.MIT.EDU (Eric Youngdale)
Wed Aug 26 03:22:58 1998
Date: Wed, 26 Aug 1998 00:26:21 -0400 (EDT)
From: Eric Youngdale <eric@andante.jic.com>
To: Andrzej Krzysztofowicz <ankry@green.mif.pg.gda.pl>
cc: linux-scsi@vger.rutgers.edu, alan@lxorguk.ukuu.org.uk,
torvalds@transmeta.com
In-Reply-To: <199808250854.KAA12074@green.mif.pg.gda.pl>
On Tue, 25 Aug 1998, Andrzej Krzysztofowicz wrote:
> > While it certainly looks like we have a bug, I am not sure if I
> > agree with the proposed patch. It looks like you are making a second
> > attempt to remove the entry from the linked list, when in fact this should
> > have already happened. Wouldn't it be sufficient to simply do:
> >
> > > - if (max_scsi_hosts == next_scsi_host)
> > > - max_scsi_hosts--;
> > > -
> > > + if(max_scsi_hosts == next_scsi_host
> > > + && sh->host_no == max_scsi_hosts - 1) {
> > > + --max_scsi_hosts;
> > > + }
> >
> > -Eric
>
> Your version of patch seems to be minimal bugfix for the problem.
> But it limits reusing of host numbers very much.
>
> Notice that
> max_scsi_hosts == next_scsi_host
> only if all(!) host numbers 0, 1, ..., max_scsi_hosts-1 are curently used.
> max_scsi_hosts - it's maximal used host number minus 1,
> next_scsi_host - it's number of curently used host numbers;
> it should always be next_scsi_host <= max_scsi_hosts
> equality ONLY if all: 0, 1, ..., max_scsi_hosts-1 are curently used
>
> In my opinion names of above variables do not fit their role - maybe they
> should be changed ???
Ahhh, now I see what it is that you are trying to do. In this
case, I have a suggestion - add a comment to that piece of code explaining
what it is that you are trying to accomplish :-).
-Eric
-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu