Re: [v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading

2014-09-18 Thread Oleg Nesterov
On 09/18, Roman Peniaev wrote: > > If my final understanding is right (please, correct me if I am still wrong), > following reordering can happen, but we are fine with it: > > wake_up_rootfs wait_event > > LOCK > check the list, but empty > set CONDITION <<< reordered > UNLOCK Yes,

Re: [v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading

2014-09-18 Thread Roman Peniaev
On Thu, Sep 18, 2014 at 2:46 AM, Oleg Nesterov wrote: > On 09/17, Roman Pen wrote: >> >> +void wait_for_rootfs(void) >> +{ >> + /* Avoid waiting for ourselves */ >> + if (is_global_init(current)) >> + pr_warn("init: it is not a good idea to wait for the rootfs >> mount from th

Re: [v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading

2014-09-17 Thread Oleg Nesterov
On 09/17, Roman Pen wrote: > > +void wait_for_rootfs(void) > +{ > + /* Avoid waiting for ourselves */ > + if (is_global_init(current)) > + pr_warn("init: it is not a good idea to wait for the rootfs > mount from the init task\n"); > + else > + wait_event(rootfs_

[v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading

2014-09-17 Thread Roman Pen
The thing is that built-in modules are being inited before rootfs mount. Some of the modules can request firmware loading from another thread using async 'request_firmware_nowait' call on inition, so we can catch this kind of race: rootfs does not exist yet, but we are going to open and load