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

2014-09-20 Thread Roman Peniaev
On Sat, Sep 20, 2014 at 11:42 PM, Greg Kroah-Hartman wrote: > On Sat, Sep 20, 2014 at 10:18:39PM +0900, Roman Peniaev wrote: >> On Sat, Sep 20, 2014 at 6:42 AM, Greg Kroah-Hartman >> wrote: >> > On Fri, Sep 19, 2014 at 09:44:24PM +0900, Roman Pen wrote: >> >> The thing is that built-in modules ar

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

2014-09-20 Thread Greg Kroah-Hartman
On Sat, Sep 20, 2014 at 10:18:39PM +0900, Roman Peniaev wrote: > On Sat, Sep 20, 2014 at 6:42 AM, Greg Kroah-Hartman > wrote: > > On Fri, Sep 19, 2014 at 09:44:24PM +0900, Roman Pen wrote: > >> The thing is that built-in modules are being inited before > >> rootfs mount. Some of the modules can r

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

2014-09-20 Thread Roman Peniaev
Thanks, Oleg, for the review. -- Roman On Sat, Sep 20, 2014 at 4:45 AM, Oleg Nesterov wrote: > On 09/19, Roman Pen wrote: >> >> +void wait_for_rootfs(void) >> +{ >> + /* Here we try to protect from a few things: >> + * 1. Avoid waiting for ourselves, when init thread has not >> + *

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

2014-09-20 Thread Roman Peniaev
On Sat, Sep 20, 2014 at 6:42 AM, Greg Kroah-Hartman wrote: > On Fri, Sep 19, 2014 at 09:44:24PM +0900, Roman Pen wrote: >> 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_firmw

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

2014-09-19 Thread Greg Kroah-Hartman
On Fri, Sep 19, 2014 at 09:44:24PM +0900, Roman Pen wrote: > 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:

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

2014-09-19 Thread Oleg Nesterov
On 09/19, Roman Pen wrote: > > +void wait_for_rootfs(void) > +{ > + /* Here we try to protect from a few things: > + * 1. Avoid waiting for ourselves, when init thread has not > + *mounted rootfs yet. > + * 2. Avoid warning if call chain was initiated from userspace > +

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

2014-09-19 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