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

From: Oleg Nesterov
Date: Wed Sep 17 2014 - 14:02:31 EST


On 09/17, Roman Peniaev wrote:
>
> On Tue, Sep 16, 2014 at 1:39 AM, Oleg Nesterov <oleg@xxxxxxxxxx> wrote:
> > On 09/15, Roman Pen wrote:
> >>
> >
> > Otherwise wait_for_rootfs() can return only once, the next call will block
> > forever. And perhaps it would be better to use another primitive, even if
> > UINT_MAX/2 should be enough.
>
> And why do you think completion is not good for this?
> Seems it is impossible to have so many threads on early init, which wait
> for rootfs.

Yes, but it is not only called during init? Suppose that a user does
insmod + rmmod in a loop, and the driver calls request_firmware(). This
will hang after UINT_MAX/2 iterations. Sure, this can't happen in practice,
but still this doesn't look good imho.

Oleg.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/