Re: Syquest drive trouble: Allows ejects.

Grant R. Guenther (grant@gear.torque.net)
Sun, 14 Apr 1996 06:12:22 -0400 (EDT)


> I've got a Syquest EZ-Drive as /dev/hdc. Under Linux, ejection can be
> stopped in software. So, while a filesystem is mounted I can press the
> button and the eject will be deferred till I unmount it.

Funny you should mention this !

> However, I have noticed that I can also eject the disk under these
> conditions:
> mount -t ext2 /dev/hdc1 /sy
> dd if=/dev/hdc1 of=/dev/null count=1
> Now the eject button causes the drive to spin down even though
> /dev/hdc1 is still mounted.

There was another problem with removable media in both the ide and scsi
disk drivers. When the device is closed with ide_release or sd_release,
the driver doesn't wait for the sync to complete before unlocking the
door. Under some circumstances, this can result in the disk being ejected
before writing has completed. Not good.

I was working on a patch for that problem when I noticed that the ide
driver does not maintain an access count, as the scsi driver does. I
wondered whether that was also a problem, and now you have confirmed it -
one day later :-)

> I think that some sort of checking needs to be added in
> drivers/block/ide.c:ide_open() and :ide_release(), perhaps a counter that
> is incremented and then decremented. However, I haven't looked at the code
> too closely, and I'm not sure exactly when ide_release() gets called.

I think I agree that this is what should be done. Mark ?

--------------------------------------------------------------------------
Grant R. Guenther grant@torque.net
--------------------------------------------------------------------------