From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ananth N Mavinakayanahalli Date: Mon, 09 Feb 2004 05:51:16 +0000 Subject: Re: inconsistent renaming of devices Message-Id: <20040209055116.GA17406@in.ibm.com> List-Id: References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org On Sun, Feb 08, 2004 at 03:13:23PM +0100, Olaf Hering wrote: > > No, that was about that fact that block (and scsi) events run much > earlier than expected. The properties below /block/sda/device/ and > /sys/bus/*/devices/$bus_id appear to late, the result is that the > BUS="scsi" rule doesnt match and it falls through to the BUS="usb" rule. > I have to add sleep 3 in case of my USB stick. > > It would make sense to run the /block/sda event just before the > /block/sda/sda1 event (if there is a partition table). sda1 has always > all properties in /block/sda/sda1/../device/ > > sysfs_path_is_link() does a stat(/sys/bus/*/devices/$bus_id) and this does > not exist. > > Now, this little hack, and the result looks much better. Wouldn't it be much better if you increase the wait time in get_sysfs_device() in namedev.c from 10ms instead of adding a retry loop? > @@ -79,6 +82,12 @@ int sysfs_get_device_bus(struct sysfs_de > } > } > } > + if(--retries) { > + dprintf("sleep one second for %s\n", dev->bus_id); > + sleep(1); > + dprintf("retries left: %d\n", retries); > + goto retry; > + } > sysfs_close_list(buslist); > } > return -1; I am not in favour of sleep()ing inside the library. I'd rather the app handle sleep and retries :) Thanks, Ananth ------------------------------------------------------- The SF.Net email is sponsored by EclipseCon 2004 Premiere Conference on Open Tools Development and Integration See the breadth of Eclipse activity. February 3-5 in Anaheim, CA. http://www.eclipsecon.org/osdn _______________________________________________ Linux-hotplug-devel mailing list http://linux-hotplug.sourceforge.net Linux-hotplug-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/linux-hotplug-devel