Messages in this thread | | | Date | Thu, 5 Feb 2004 21:54:21 +0100 | From | Jens Axboe <> | Subject | Re: 2.6.0, cdrom still showing directories after being erased |
| |
On Thu, Feb 05 2004, Thomas Glanzmann wrote: > Hi, > > > now I got the error which I would expect after erasing the CD and trying > > to mount it > > > seems to me like some cache should have been invalidated, but was not > > I hit at this problem while I was writing an IDE Atapi simulator for > FAUmachine. The problem is that the kernel asks the CDROM if the 'disc > has changed', which means that the disc was ejected and reinserted, and > if this *isn't* the case the vfs or whatever assumes that the media > hasn't changed and so the buffers will not be flushed. You can cirumvent > this problem if you just eject and load the media back again. > > And this isn't an issue of the cdrom (because my virtual cdrom on > FAUmachine has no buffer) but an issue of the kernel caching. > > The linux kernel atapi layer makes a TEST UNIT READY and if the media > has changed the cdrom does return an ERR_STAT with a UNIT_ATTENTION > which means that the medium has changed. IF that this the case the > kernel flushes it's buffers.
So the drive ought to report media changed if it knowingly over wrote the table of contents, for instance.
I still think this is to be expected when mucking in undefined teritory. Reload the media, it's not hard... Sure you can get around this with snooping if you really wanted to, but IMO it's wasted effort. Add -eject to cdrecord command line of default config, how you want so solve it is not my problem.
-- Jens Axboe
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |