[7837] in linux-scsi channel archive

home help back first fref pref prev next nref lref last post

Re: [Question] rscsi_disks[].device being NULL

daemon@ATHENA.MIT.EDU (Eric Youngdale)
Sun Jan 16 13:03:06 2000

Message-ID: <007601bf6026$c7977980$2017a8c0@eric.home>
From: "Eric Youngdale" <eric@andante.org>
To: "Alexander Viro" <viro@math.psu.edu>,
	"Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: <linux-scsi@vger.rutgers.edu>
Date:   Sun, 16 Jan 2000 00:21:38 -0500
MIME-Version: 1.0
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: 7bit


    The .device field is set during the bus scan, essentially during
sd_attach.  After this is done, sd_finish is called for post-processing,
which is where you end up calling scsi_init_onedisk et. al.  I cannot tell
quite what code you are referring to, but my guess is that you are looking
at a chunk of sd_finish() where we loop over the devices.  The idea is that
an element of rscsi_disks[] with a NULL .device field is essentially an
unused slot that could be used if a new device were to appear as a result of
a new module being loaded.  If you were to unload a low-level driver, the
sd_detach() function would zero the .device field when it disconnects so
that the slot becomes unused.

    The code in question is simply looping over all of the known devices.

    Does this answer your question?

-Eric

----- Original Message -----
From: "Alexander Viro" <viro@math.psu.edu>
To: "Alan Cox" <alan@lxorguk.ukuu.org.uk>
Cc: <linux-scsi@vger.rutgers.edu>
Sent: Friday, January 14, 2000 4:02 AM
Subject: [Question] rscsi_disks[].device being NULL


> ... how can it happen in revalidate_scsidisk()? Immediately before
> checking for it we do scsi_init_onedisk(target); and this one would die
> horrible death if rscsi_disk[target].device was NULL. So either it's too
> late or it is always false. Unless you object I'll remove it - it stands
> on the way of resetup_one_dev() patch...
> Al
>
>
> -
> To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
> the body of a message to majordomo@vger.rutgers.edu
>


-
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.rutgers.edu

home help back first fref pref prev next nref lref last post