Re: [PATCH] devinet: inetdev_init out label moved after RCU assignment
From: Herbert Xu <[EMAIL PROTECTED]> Date: Fri, 5 Jan 2007 22:23:53 +1100 > On Fri, Jan 05, 2007 at 12:19:10PM +0100, Jarek Poplawski wrote: > > > > Why me? (I didn't spoil this!) > > You spotted the problem, so it's only fair that you get the credit :) > > > Subject: [PATCH] devinet: inetdev_init out label moved after RCU assignment > > > > inetdev_init out label moved after RCU assignment > > (final suggestion by Herbert Xu) > > > > Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> > > Thanks, looks good to me. Applied, thanks everyone. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] devinet: inetdev_init out label moved after RCU assignment
Yeah, sure. +-DLS Acked-by: David L Stevens <[EMAIL PROTECTED]> > Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> > > --- > > diff -Nurp linux-2.6.20-rc3-/net/ipv4/devinet.c linux-2.6.20-rc3/net/ipv4/devinet.c > --- linux-2.6.20-rc3-/net/ipv4/devinet.c 2007-01-05 11:53:16.0 +0100 > +++ linux-2.6.20-rc3/net/ipv4/devinet.c 2007-01-05 11:55:32.0 +0100 > @@ -174,9 +174,10 @@ struct in_device *inetdev_init(struct ne > ip_mc_init_dev(in_dev); > if (dev->flags & IFF_UP) >ip_mc_up(in_dev); > -out: > + > /* we can receive as soon as ip_ptr is set -- do this last */ > rcu_assign_pointer(dev->ip_ptr, in_dev); > +out: > return in_dev; > out_kfree: > kfree(in_dev); > - > To unsubscribe from this list: send the line "unsubscribe netdev" in > the body of a message to [EMAIL PROTECTED] > More majordomo info at http://vger.kernel.org/majordomo-info.html - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] devinet: inetdev_init out label moved after RCU assignment
On Fri, Jan 05, 2007 at 10:23:53PM +1100, Herbert Xu wrote: > On Fri, Jan 05, 2007 at 12:19:10PM +0100, Jarek Poplawski wrote: > > > > Why me? (I didn't spoil this!) > > You spotted the problem, so it's only fair that you get the credit :) Strange... It recalls me the army now! (many years ago) Jarek P. - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
Re: [PATCH] devinet: inetdev_init out label moved after RCU assignment
On Fri, Jan 05, 2007 at 12:19:10PM +0100, Jarek Poplawski wrote: > > Why me? (I didn't spoil this!) You spotted the problem, so it's only fair that you get the credit :) > Subject: [PATCH] devinet: inetdev_init out label moved after RCU assignment > > inetdev_init out label moved after RCU assignment > (final suggestion by Herbert Xu) > > Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> Thanks, looks good to me. -- Visit Openswan at http://www.openswan.org/ Email: Herbert Xu ~{PmV>HI~} <[EMAIL PROTECTED]> Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html
[PATCH] devinet: inetdev_init out label moved after RCU assignment
On Fri, Jan 05, 2007 at 08:38:47PM +1100, Herbert Xu wrote: > On Fri, Jan 05, 2007 at 07:38:44AM +0100, Jarek Poplawski wrote: > > > > I'd only suggest to change "goto out;" to > > "return NULL;" at the end of inetdev_init because > > now RCU is engaged unnecessarily. > > I agree. The RCU assignment should come before the out label. > Can you send a patch? Why me? (I didn't spoil this!) Cheers, Jarek P. PS: should be applied after David's Stevens patch from 2007.01.04 --- Subject: [PATCH] devinet: inetdev_init out label moved after RCU assignment inetdev_init out label moved after RCU assignment (final suggestion by Herbert Xu) Signed-off-by: Jarek Poplawski <[EMAIL PROTECTED]> --- diff -Nurp linux-2.6.20-rc3-/net/ipv4/devinet.c linux-2.6.20-rc3/net/ipv4/devinet.c --- linux-2.6.20-rc3-/net/ipv4/devinet.c2007-01-05 11:53:16.0 +0100 +++ linux-2.6.20-rc3/net/ipv4/devinet.c 2007-01-05 11:55:32.0 +0100 @@ -174,9 +174,10 @@ struct in_device *inetdev_init(struct ne ip_mc_init_dev(in_dev); if (dev->flags & IFF_UP) ip_mc_up(in_dev); -out: + /* we can receive as soon as ip_ptr is set -- do this last */ rcu_assign_pointer(dev->ip_ptr, in_dev); +out: return in_dev; out_kfree: kfree(in_dev); - To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to [EMAIL PROTECTED] More majordomo info at http://vger.kernel.org/majordomo-info.html