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

Alan Stern
2003-07-09T13:50:08Z

On Tue, 8 Jul 2003, Mike Anderson wrote:

> 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).

Interesting. As I understand it, remove() is called from the SCSI core
whereas block_release() is called through the filesystem. The two code
paths only intersect in sr.c. So how does the core know when opens drops
to 0?

> 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).

I'm looking forward to seeing the end results. Incidentally, it turns out
that my patch still needs some minor fixups. Locking is notoriously
difficult to get exactly right. But it can wait until after this other
stuff is finished.

Speaking of /proc/scsi, have you given any thought to making the procinfo
contents available through sysfs? That way the /proc entry points can be
deprecated and eventually removed, but the information will still be
easily available.

Alan Stern