Lucas De Marchi <lucas.de.mar...@gmail.com> writes: > On Wed, Feb 18, 2015 at 2:07 AM, Rusty Russell <ru...@rustcorp.com.au> wrote: > Yeah, I just thought (an wanted that) the attributes were being > created first and then hooked up in the sysfs tree under > /sys/module/<modulename>. I.e. if the directory exists and there's no > initstate this is because it's a builtin module. I don't want to > wait/sleep on the file to appear because users of > kmod_module_get_initstate() may not tolerate this behavior. > > Looking up at the old module-init-tools, it used an ugly loop with > usleep() before trying to read the file again :-/ > > Can we change kernel side guaranteeing the initstate file appears > together with the directory?
Greg? The core problem is that kmod looks for /sys/module/<name>/initstate; if it's not there, it assumes a builtin module. However, this is racy when a module is being inserted. Is there a way to create this sysfs file and dir atomically? Thanks, Rusty. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/