usb floppy delays in /sys

Luke Kenneth Casson Leighton lkcl at lkcl.net
Thu Sep 16 09:58:01 PDT 2004


On Thu, Sep 16, 2004 at 06:13:44PM +0200, David Zeuthen wrote:
> On Thu, 2004-09-16 at 16:31 +0100, Luke Kenneth Casson Leighton wrote:
> > On Thu, Sep 16, 2004 at 04:41:05PM +0200, David Zeuthen wrote:
> > > On Thu, 2004-09-16 at 15:39 +0100, Luke Kenneth Casson Leighton wrote:
> > > > here y'go.
> > > > 
> > > > HAL_INFO (("%s, SEQNUM=%d subsystem=%s sysfs_path=%s",
> > > > (is_add ? "add" : "rem"), seqnum, subsystem,
> > > > sysfs_path_full));
> > > > 
> > > > 	if (is_add) {
> > > > 		int count = 5;
> > > > 		do {
> > > > 			d = add_device (sysfs_path_full, subsystem);
> > > > 			if (d == NULL)
> > > > 				sleep(1);
> > > > 		} while (d == NULL && count-- > 0);
> > > > 
> > > > 
> > > 
> > > Thanks, but this is probably not the right fix IMO; instead you should
> > > be extending the list of sysfs file we wait for in tools/hal_hotplug.c.
> > > Will that work? 
> > 
> >  ... i imagine so: it's the same desired effect (i'm pleased to note
> >  you've catered for this!)
> >
> >  so, lshal output attached... minus irrelevant stuff.
> > 
> 
> Cool, you got a patch for this? It works out of the box for me with my
> Lacie USB Floppy Drive so I can't really reproduce the problem.
 
 i'm using selinux [on debian.  with udev. don't ask] so
 there's a significant delay of about 1/3 to 1/2 a second on device
 inode creation as it is.

 so it's a more a matter of you _would_ possibly come across it -
 on a particularly busy computer - and have things inexplicably fail.

 what i've added [above] falls into the "ItWorksForMe(tm)" category
 and it was very easy do add: track down the debug message "d is NULL!"
 and add in the sleep(1).

 i did the same thing for the hacked-up version of usbmount because that
 shellscript suffered from the same problem [it uses /usr/bin/sg_map
 and also hunts through /sys only to find that the entry isn't there
 but is 5 seconds later].


 regarding a patch: to hal_hotplug.c?

 i wouldn't know where to start... okay... how would i determine the
 correct sysfs file type?

 l.

_______________________________________________
hal mailing list
hal at freedesktop.org
http://freedesktop.org/mailman/listinfo/hal



More information about the Hal mailing list