[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CACZ9PQWDynSqUREO_79e5DFKqhV62ra3ecYYaNttOdNx4wS6_A@mail.gmail.com>
Date: Fri, 19 Sep 2014 21:41:09 +0900
From: Roman Peniaev <r.peniaev@...il.com>
To: Oleg Nesterov <oleg@...hat.com>
Cc: Ming Lei <ming.lei@...onical.com>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org
Subject: Re: [v3 PATCH 1/1] init: fix race between rootfs mount and firmware loading
On Fri, Sep 19, 2014 at 2:41 AM, Oleg Nesterov <oleg@...hat.com> wrote:
> On 09/18, Roman Pen wrote:
>>
>> +void wait_for_rootfs(void)
>> +{
>> + /* Avoid waiting for ourselves */
>> + if (WARN_ON(is_global_init(current)))
>> + return;
>> + else
>> + wait_event(rootfs_waitq, rootfs_mounted);
>> +}
>
> Ah, wait, the is_global_init() check doesn't look right in any case.
>
> What if /sbin/init does sys_init_module() and this module does
> request_firmware() ?
Yeah, right. It turned out to be more tricky than I expected.
Will fix.
>
> I think we should only warn if init is going to wait,
>
> /* Avoid waiting for ourselves */
> if (rootfs_mounted || WARN_ON(is_global_init(current)))
> return;
>
> __wait_event(rootfs_waitq, rootfs_mounted);
>
>
>> +EXPORT_SYMBOL(wait_for_rootfs);
>
> Why?
CONFIG_FW_LOADER (which includes firmware_class.c to compilation
sequence) is declared as tristate,
thus it can be built as module. Seems I can break loading of this
module if skip exporting, right?
--
Roman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists