From: David Ahern <d...@cumulusnetworks.com> Date: Tue, 17 Jan 2017 14:57:36 -0800
> Trying to add an mpls encap route when the MPLS modules are not loaded > hangs. For example: ... > The problem is that lwtunnel_build_state is called with rtnl lock > held preventing mpls_init from registering. > > Given the potential references held by the time lwtunnel_build_state it > can not drop the rtnl lock to the load module. So, extract the module > loading code from lwtunnel_build_state into a new function to validate > the encap type. The new function is called while converting the user > request into a fib_config which is well before any table, device or > fib entries are examined. > > Fixes: 745041e2aaf1 ("lwtunnel: autoload of lwt modules") > Signed-off-by: David Ahern <d...@cumulusnetworks.com> > --- > v2 > - extract the module load attempt into a separate function that is > called early in the newroute code paths Ok, this looks like it should work. Assuming it passed my build tests, I'll push this out and queue it for -stable. Thanks!