devfs
[Top] [All Lists]

Re: Removeable Media, partitions and devfs?

To: "Richard Gooch" <rgooch@xxxxxxxxxxxxxxx>
Subject: Re: Removeable Media, partitions and devfs?
From: "Kevin P. Fleming" <kevin@xxxxxxxxxxxxx>
Date: Mon, 10 Dec 2001 13:41:06 -0700
Cc: "Paul Bristow" <paul@xxxxxxxxxxxxxxx>, <Andrej.Borsenkow@xxxxxxxxxxxxxx>, <devfs@xxxxxxxxxxx>
Organization: LSG, Inc.
References: <3C0C9AC5.4080504@xxxxxxxxxxxxxxx><001801c17d15$758b6760$c8aaa8c0@kevin><3C0D588F.9000806@xxxxxxxxxxxxxxx><03be01c17d20$5d1b72f0$c8aaa8c0@kevin><200112050639.fB56d0a05344@xxxxxxxxxxxxxxxxxxxxxxxx><00e901c17dd2$8ccffe50$c8aaa8c0@kevin><200112060633.fB66XoZ22006@xxxxxxxxxxxxxxxxxxxxxxxx><3C0FED36.9050506@xxxxxxxxxxxxxxx><010b01c17f4f$87b478a0$c8aaa8c0@kevin> <200112090303.fB933vw04632@xxxxxxxxxxxxxxxxxxxxxxxx>
Sender: owner-devfs@xxxxxxxxxxx
----- Original Message -----
From: "Richard Gooch" <rgooch@xxxxxxxxxxxxxxx>
To: "Kevin P. Fleming" <kevin@xxxxxxxxxxxxx>
Cc: "Paul Bristow" <paul@xxxxxxxxxxxxxxx>;
<Andrej.Borsenkow@xxxxxxxxxxxxxx>; <mfedyk@xxxxxxxxxxxxx>;
<devfs@xxxxxxxxxxx>
Sent: Saturday, December 08, 2001 8:03 PM
Subject: Re: Removeable Media, partitions and devfs?


> Kevin P. Fleming writes:
> > > > So, let me get this right (I haven't looked closely at ide-floppy,
so
> > > > bear with me): when there is no media present, the driver sets the
> > > > size to zero at revalidate time, even if previously the size was
> > > > non-zero?
> > >
> > >
> > > At the moment no.  But it could :-)
> >
> > Are you sure that's a reasonable thing to do? It seems that the size
> > variable should accurately reflect the size of the device at that
> > moment, and if it doesn't who's to say that won't cause other side
> > effects in the grok_partitions and related code in the future? Seems
> > a bit risky to me, "overloading" this variable to make sure that the
> > devfs code works in the way we all want it to.
>
> Actually, that variable was already overloaded to stop
> grok_partitions() from reading a partition table.
>

OK, with the new ide-floppy media change detection, this is exactly what
happens. If check_media_change gets called and there is currently no media
in the drive, or unformatted media in the drive, then a "size" of 0 is
passed to grok_partitions.

This leads to existing partX entries not being removed, as grok_partitions
does not make any attempt to update the partition information. If I forcibly
pass a non-zero size, grok_partitions cleans up the old entries, but only
after generating at least two IDE I/O errors in the system log as it tries
to read the partition table from the disk. If I had other partition methods
compiled in my kernel, I'm sure it would generate even more errors.

Any suggestions on how you want see this handled? This is (somewhat) where I
arrived previously, in that the driver knows that the partition entries need
to be removed, but has no direct way to cause that to happen.

Also, remember that we still have the problem where the disc directory and
its entries are not removed when ide-floppy or ide-hd are unloaded, leading
to an oops if you try to access any of those entries (since the ops pointers
that devfs stored are no longer valid).


<Prev in Thread] Current Thread [Next in Thread>