Re: drivers/block/ub.c

From: Alan Stern
Date: Mon Jun 28 2004 - 10:44:20 EST


On Sun, 27 Jun 2004, Pete Zaitcev wrote:

> On Sun, 27 Jun 2004 11:23:10 -0400 (EDT)
> Alan Stern <stern@xxxxxxxxxxxxxxxxxxx> wrote:
>
> > + * -- use serial numbers to hook onto same hosts (same minor) after
> > disconnect
>
> It was a poor wording by me. It refers to the drift of naming due to
> increments in usb_host_id. After a disconnect and reconnect, /dev/uba1
> refers to the device, but /proc/partitions says "ubb".
>
> To correct this, I have to set gendisk->fist_minor before calling
> add_disk(), but in order to do that, a driver has to track devices
> somehow. A serial number looks like an obvious candidate for a key.

I don't fully understand the nature of this problem. Is it that ub always
assigns the _first_ available minor number whereas add_disk() tries to
assign the _next_ available? If so, how does tracking devices help?
Shouldn't you just always want add_disk() to use the same minor number as
ub?

Or maybe I've misunderstood completely, not just partially. In any case,
are you sure you will want to do this? The directive for not tracking
serial numbers or trying in some other way to make devices appear to be
persistent across reconnects came directly from Linus.

Alan Stern

-
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/