2.2.12 SCSI CD-ROM bug

gokhan sozmen (gokhan_sozmen@hotbot.com)
Mon, 22 Nov 1999 08:33:01 -0800


Arrrgh,

I've beating my head against walls the last
two weeks trying to figure out why my SCSI driver was crashing and panic'ing under heavy
load on an SMP system. I was seeing cases
where the scatter gather list memory was
being released and re-used before the owning
SCSI command completed.

I would see instances where I would receive
a SCSI command from the middle layer and
the sg buffer pointer in the scsi command
would actually be in use by another active
scsi command as well.

The system sometimes froze with no indication
of what was going on. A couple of times I got
a "scsi_free:trying to free unused memory"
panics.

Finally I got Scott Foehner's remote kernel debugging patch (http://reality.sgi.com/
sfoehner_engr/gdb)(great tool!) and started debugging the kernel.

A couple of days ago it panic'ed in
sr.c/get_sectorsize when calling scsi_free
when I realized that the io_request_lock was not being acquired during scsi_malloc() and
scsi_allocate_device().

I unplugged the SCSI CD-ROM drive cable
and re-started my IO tests. What used to
crash in two hours now has been running
for the last five days.

This looks like a major bug for users
of an SMP/2.2.12(RH6.1)/SCSI CD-ROM/SCSI Disk
combination so I'll post this on the
linux-kernel list as well.

I saw your patch for 2.2.13 and 2.3.x,
looks like RedHat will have to issue yet
another 6.1 release though.

rgds
Gokhan Sozmen

--

On Thu, 18 Nov 1999 22:46:00 Jens Axboe wrote: >On Thu, Nov 18 1999, gokhan sozmen wrote: >> >> Looking at drivers/scsi/sr.c/get_sectorsize() >> in RH6.1 (2.2.12-20), it looks like the >> function is calling both scsi_malloc() >> and scsi_allocate_device() without >> grabbing the io_request_lock. Wouldn't this >> be a potential SMP race hazard? > >Yes and it is fixed in recent 2.3 - not sure whether I >back ported those changes to 2.2 (it's in my patch >set, but I don't think I ever got around to submitting >that part of it). > >-- >* Jens Axboe <axboe@image.dk> >* Linux CD-ROM Maintainer >* http://www.kernel.dk > >- >To unsubscribe from this list: send the line "unsubscribe linux-scsi" in >the body of a message to majordomo@vger.rutgers.edu >

HotBot - Search smarter. http://www.hotbot.com

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/