Re: removable media revalidation - udev vs. devfs or static /dev

From: Greg KH
Date: Wed Jan 07 2004 - 14:51:51 EST


On Wed, Jan 07, 2004 at 11:31:55AM -0800, Linus Torvalds wrote:
> On Wed, 7 Jan 2004, Greg KH wrote:
> > > But udev should probably also create all the sub-nodes if it doesn't
> > > already.
> >
> > It doesn't, as I thought we could rely on the kernel partition support.
>
> Indeed, we _can_ rely on the kernel partition support, but the subnodes
> are needed to get at those partitions.
>
> Obviously, a "repartitioning hotplug event" can create the subnodes, but
> that will fail exactly because it wouldn't allow the user to just access
> the nodes.

It sounds like just having the device node around will not cause the
rescan if you access it. I don't have any such devices here to test
this out or not. If true, having udev create all nodes will not help
out much :(

> > Hm, that would work, but what about a user program that just polls on
> > the device, as the rest of this thread discusses?
>
> I hate those "background CPU users". Have you looked at "ps" output after
> something like kscd has run, and does a CD check every second? It's
> _expensive_. It goes all the way down to the hardware, sends a request
> to the device.

Oh I know, it's one of the first things I disable when setting up a box :)

> Doing it every five minutes wouldn't be an issue, but doing it every five
> minutes would be absolutely _horrible_ from a user perspective standpoint.
> If you insert a smartmedia card in your cardreader, you expect to be able
> to access it pretty much immediately when you start typing. So a second or
> two of delay is fine, but even just five or ten seconds are already bad.
>
> So the choice is:
> - probe every removable device once a second
> - pre-populate the device nodes, and when the user presses the icon that
> says "mount", it will just do so. Immediately. No delay at all.

Based on the previous info, I think we are stuck with probing :(

> NOTE! We do have an alternative: if we were to just make block device
> nodes support "readdir" and "lookup", you could just do
>
> open("/dev/sda/1" ...)
>
> and it magically works right. I've wanted to do this for a long time, but
> every time I suggest allowing it, people scream.

Hm, that would be nice. I don't remember seeing it being proposed
before, what are the main complaints people have with this?

thanks,

greg k-h
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/