<< | Thread Index | >> ]    [ << | Date Index | >> ]

Subject: Re: [PATCH] Deadlock under Linux 2.4
From: Myles Uyema <myles,AT,puck,DOT,nether,DOT,net>
Date: Fri, 20 Oct 2000 04:42:25 +0200
In-reply-to: <E13mECN-0001Wa-00@g212.hadiko.de>

I build cipe-1.4.3 with your patch, and load it in 2.4.0-test9:
cipcb: CIPE driver vers 1.4.3 (c) Olaf Titz 1996-2000, 100 channels, debug=8
RTNL: assertion failed at devinet.c(775):inetdev_event

I haven't started the ciped-cb daemon yet, and I'm afraid to =)

On Thu, 19 Oct 2000, Olaf Titz wrote:

> The attached patch (which should apply cleanly to CIPE 1.4.x with some
> fuzz) fixes a deadlock in dynamic device allocation under Linux 2.4.
> Anyone who uses 2.4 needs this. Looks like I'll have to make a 1.4.4
> release RSN.
> 
> It also raises the limit on devices a bit, as some people really need
> more than 100.
> 
> Olaf
> 
> --- device.c  2000/10/06 23:15:05     1.39
> +++ device.c  2000/10/19 11:11:36
> @@ -549,7 +544,6 @@
>      memset(d->broadcast, 0xFF, ETH_ALEN);
>      cc->dev.addr_len=ETH_ALEN;
> 
> -    rtnl_LOCK();
>      e=register_netdevice(&(cc->dev));
>      if (e<0) {
>       kfree(cc);
> @@ -560,7 +554,6 @@
>          cc->cipe.owner=current->pid;
>      }
>      cipe_ctrls[n]=cc;
> -    rtnl_UNLOCK();
>      return e;
>  }
> 
> @@ -574,14 +567,11 @@
>          printk(KERN_WARNING DEVNAME ": Ouch: cipe_unalloc_dev() wrong 
>struct\n");
>          return;
>      }
> -    rtnl_LOCK();
>      unregister_netdevice(&(cc->dev));
>      cipe_ctrls[n]=NULL;
> -    rtnl_UNLOCK();
>      kfree(cc);
>  }
> 
> -
>  int init_module(void)
>  {
>      int e=cipe_check_kernel();
> @@ -590,7 +580,11 @@
> 
>      /* sanity check on insmod-provided data */
>      if (cipe_maxdev<1)  cipe_maxdev=1;
> +#ifdef NO_DYNDEV
>      if (cipe_maxdev>100) cipe_maxdev=100;
> +#else
> +    if (cipe_maxdev>10000) cipe_maxdev=10000;
> +#endif
> 
>  #ifdef DEBUG
>      printk(KERN_INFO
> @@ -614,9 +608,13 @@
>  #ifdef NO_DYNDEV
>      {
>          int i;
> +     rtnl_LOCK();
>          for (i=0; i<cipe_maxdev; ++i)
> -            if ((e=cipe_alloc_dev(i)))
> +            if ((e=cipe_alloc_dev(i))) {
> +             rtnl_UNLOCK();
>                  return e;
> +         }
> +     rtnl_UNLOCK();
>          return 0;
>      }
>  #else
> @@ -627,8 +625,10 @@
>  void cleanup_module(void)
>  {
>      int i;
> +    rtnl_LOCK();
>      for (i=0; i<cipe_maxdev; ++i)
>       cipe_unalloc_dev(i);
> +    rtnl_UNLOCK();
>      kfree(cipe_ctrls);
>  }
> 
> === end of patch ===
> 
> --
> Message sent by the cipe-l,AT,inka,DOT,de mailing list.
> Unsubscribe: mail majordomo,AT,inka,DOT,de, "unsubscribe cipe-l" in body
> Other commands available with "help" in body to the same address.
> CIPE info and list archive: 
><URL:http://sites.inka.de/~bigred/devel/cipe.html>
> 





<< | Thread Index | >> ]    [ << | Date Index | >> ]