lkml.org 
[lkml]   [2014]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [v2 PATCH 1/1] init: fix race between rootfs mount and firmware loading
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_waitq, rootfs_mounted);
> +}

Well, this pr_warn() doesn't look very useful, how about

if (WARN_ON((is_global_init(current))))
return;

? this will show the caller.

> +static inline void wake_up_rootfs_waiters(void)
> +{
> + rootfs_mounted = true;
> + /* wake_up guarantees write memory barrier if and only if
> + there is a task to be woken up, it is not always true
> + for our case. */

Yes, but this doesn't matter. wait_event() takes care,

> + smp_wmb();

so please remove this wmb() and the comment.

Oleg.



\
 
 \ /
  Last update: 2014-09-17 20:21    [W:0.070 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site