Re: PATCH: (as54) Fix hot-unplugging for sr.c

Mike Anderson
2003-07-08T22:11:56Z

Alan Stern [stern@rowland.harvard.edu] wrote:
> Mike:
>
> This is the final version of my patch to fix hot-unplugging for the SCSI
> cdrom driver. It prevents the private data structure from being
> deallocated until all references to it have been dropped, and it prevents
> races between sr_block_open() and sr_remove().
>
> The patch does assume, however, that it is legal to submit requests (via
> scsi_ioctl, for example) for a device that is marked offline.
>
> Similar changes may be needed for the sd, st, and sg drivers; I haven't
> looked at them.
>
> Alan Stern

Alan,
This looks like it solves the problem for sr and could be
replicated for other upper level drivers. The patch I created
works a little differently in that the remove function is not
called until opens drop to zero (if the device is open).

I started a new thread for the cleanup patches I have been
working on because I have four patches in the series (
including a refresh of your /proc/scsi fixups).

-andmike
--
Michael Anderson
andmike@us.ibm.com