Re: SCSI woes (followup)

Russell King
2002-09-25T08:41:39Z

On Tue, Sep 24, 2002 at 05:08:57PM -0700, Patrick Mansfield wrote:
> On Tue, Sep 24, 2002 at 11:39:42PM +0100, Russell King wrote:
> > Ok, as promised here's the first patch.
>
> Looks nice. I have the same comment as before about no commands.

I fail to see what the problem here is. I've repeatedly explained this.
I'm not going to explain it again; maybe it would be wise to read the
2.4.19 code? Please re-read all my mails since Sunday.

> > +static void scsi_eh_lock_done(struct scsi_cmnd *SCpnt)
> > +{
> > + struct scsi_request *SRpnt = SCpnt->sc_request;
> > +
> > + SCpnt->sc_request = NULL;
> > + SRpnt->sr_command = NULL;
> > +
> > + scsi_release_command(SCpnt);
> > + scsi_release_request(SRpnt);
> > +}
>
> This is back to my orginal point (i.e. case 1 in your other response
> about "restarting operations after error handling", I haven't figured
> out case 2 yet) - the above will not be called if there are no commands.

It seems that you've misunderstood what this code is doing.

We queue up a set of door lock requests onto the head of the queue for
each device. Each of these requests needs a "done" function (read some
of the other subsystem code to find out why, I'm not going to explain
the basics of the subsystem here) and the above code that you quoted
is it. Since we are the last user of the request and command structures
for this door lock request, we must free them to avoid leaking memory.
So we do exactly that.

The above code has _nothing_ to do with any other request what so ever
nor the state of the queues.

I fail to see what is soo difficult to grasp here.

--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux