Re: k 2.6.9: ub module causes /dev/sda and /dev/sda1 not beingcreated

From: Pete Zaitcev
Date: Sun Oct 31 2004 - 17:59:20 EST


On Sun, 31 Oct 2004 23:10:43 +0100, Fabio Coatti <cova@xxxxxxxxxxxxxxxx> wrote:

> Maybe this is not a problem, but it's supposed that a /dev/uba1 is created,
> after /dev/uba, instead of sdaX? well, on my system uba is created but
> not /dev/uba1, and I've reported below a syslog excerpt for usb flash
> pendrive;
>[...]
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 50 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: made changed
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: device 4 capacity nsec 1024000 bsize 512
> Oct 28 00:32:22 kefk kernel: uba: uba1
> Oct 28 00:32:22 kefk kernel: uba: uba1
> Oct 28 00:32:22 kefk kernel: kobject_register failed for uba1 (-17)

In your case, it's a bug which needs to be fixed. It hasn't got anything to
do with usb-storage or SCSI. But I'm still trying to find an approach which
works well. The basic problem is a combination of:
1. failure to start the device before calling add_disk
2. calling check_disk_change for all opens
3. returning a failure from media_present

If any of these conditions is removed, you will not see the problem.
I tried #1 for so-called "Key Distributed on Kernel Summit", but this
is not general enough, in particular your device appears resilient to that.

#2 would require distinguishing opens coming from user level from opens
called by the partition reading code, called indirectly from do_open.
I do not see how I can do that smoothly.

#3 causes the boolean logics on flags to become too involved.

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