From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Date: Mon, 15 Dec 2003 22:01:38 +0000 Subject: Re: Problem hotplugging USB flashdrive (race?) Message-Id: 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 Sat, Dec 13, 2003 at 01:58:57PM +0100, Bertrik Sikken wrote: > I think what happens when inserting the flash drive is this: > hotplug sees the embedded hub and mass-storage device in the > USB stick and loads usb-storage and SCSI modules. Then it > seems that scsi.agent tries to extract a number from the file > /sys/devices/<.....>/type > which appears to be an empty string according to the log. Yeah, I've seen this a lot too. userspace is a lot faster than the kernel in this instance :) > When I try to cat this file manually, it exists and it > results in the number 0, which correctly indicates a > SCSI disk with associated module sd_mod. > I can imagine that this is some kind of race condition, > where the script looks too soon for the file or its contents. Exactly. Try putting a sleep before reading the file, or loop on the file for a bit before reading it. thanks, greg k-h ------------------------------------------------------- This SF.net email is sponsored by: IBM Linux Tutorials. Become an expert in LINUX or just sharpen your skills. Sign up for IBM's Free Linux Tutorials. Learn everything from the bash shell to sys admin. Click now! http://ads.osdn.com/?ad_id78&alloc_id371&op=click _______________________________________________ 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