linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* file creation timing
@ 2005-02-02 20:53 Dave Hansen
  2005-02-02 21:13 ` Kay Sievers
  0 siblings, 1 reply; 2+ messages in thread
From: Dave Hansen @ 2005-02-02 20:53 UTC (permalink / raw)
  To: linux-hotplug

For memory hotplug, I register each of my memory kobjects, followed by
their individual files.  I'm seeing races where the hotplug scripts get
the event for the main register before all of the control files are
there.  
	
        ret = register_memory(mem, section, NULL);
	mem_create_simple_file(mem, phys_index);
	mem_create_simple_file(mem, state);
	mem_create_simple_file(mem, phys_device);

The script sees the /sys/.../memory directory before it sees the "state"
file.  Is there a handy way around this other than sleeping in the
script?  Can I somehow delay that registration event?

-- Dave



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: file creation timing
  2005-02-02 20:53 file creation timing Dave Hansen
@ 2005-02-02 21:13 ` Kay Sievers
  0 siblings, 0 replies; 2+ messages in thread
From: Kay Sievers @ 2005-02-02 21:13 UTC (permalink / raw)
  To: linux-hotplug

On Wed, 2005-02-02 at 12:53 -0800, Dave Hansen wrote:
> For memory hotplug, I register each of my memory kobjects, followed by
> their individual files.  I'm seeing races where the hotplug scripts get
> the event for the main register before all of the control files are
> there.  
> 	
>         ret = register_memory(mem, section, NULL);
> 	mem_create_simple_file(mem, phys_index);
> 	mem_create_simple_file(mem, state);
> 	mem_create_simple_file(mem, phys_device);
> 
> The script sees the /sys/.../memory directory before it sees the "state"
> file.  Is there a handy way around this other than sleeping in the
> script?

You may use udev to manage the hotplug events by setting /sbin/udevsend
as the hotplug helper. It will wait until sysfs is populated.

>   Can I somehow delay that registration event?

No, not today, not without doing crazy stuff.

Kay



-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-02-02 21:13 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-02-02 20:53 file creation timing Dave Hansen
2005-02-02 21:13 ` Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).