Subject: Re: sd: MEDIA_LOADED not reset on last close?
To: Mark Brinicombe <amb@physig4.ph.kcl.ac.uk>
From: Leo Weppelman <leo@wau.mis.ah.nl>
List: tech-kern
Date: 05/06/1996 16:23:30
> 
> >I was wondering if there is a good reason why the sdclose function does not
> >reset the SDEV_MEDIA_LOADED flag on the last close on the device. The unwanted
> >(at least for me) side effect is that the disklabel will only be read on
> >the first open.
> This is a problem I have had as well. My problem was with some optical drives
> e.g. Panasonic PD drive then mean the disklabel did not get reloaded
> when I swapped disk. I just added a bit to sdclose() to clear this
> flag on the last close.
> I suspect that in my case the drive is meant to report a unit attention
> command when the media is changed (this will cause a disklabel re-read)
This is indeed the required behaviour.
> but the pd drive does not do this which means that is it very easy to
> trash PD discs unless sdclose is fixed.
Looking at the code, it seems that you can low-format the drive (using
commands from scsiio.h) and still be stuck with the old disklabel....

Leo.