Received: by oss.sgi.com id ; Mon, 19 Jun 2000 09:03:34 -0700 Received: from smtprch1.nortelnetworks.com ([192.135.215.14]:63441 "EHLO smtprch1.nortel.com") by oss.sgi.com with ESMTP id ; Mon, 19 Jun 2000 09:03:11 -0700 Received: from zrchb213.us.nortel.com (actually zrchb213) by smtprch1.nortel.com; Mon, 19 Jun 2000 11:01:42 -0500 Received: from zctwb003.asiapac.nortel.com ([47.152.32.111]) by zrchb213.us.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id MPD1ZH4K; Mon, 19 Jun 2000 11:02:37 -0500 Received: from pwold011.asiapac.nortel.com ([47.181.193.45]) by zctwb003.asiapac.nortel.com with SMTP (Microsoft Exchange Internet Mail Service Version 5.5.2650.21) id NCLF8BDJ; Tue, 20 Jun 2000 02:02:39 +1000 Received: from uow.edu.au (IDENT:akpm@[47.181.194.111]) by pwold011.asiapac.nortel.com (8.9.3/8.9.3) with ESMTP id CAA10603; Tue, 20 Jun 2000 02:02:22 +1000 Message-ID: <394E4517.9028C53B@uow.edu.au> Date: Tue, 20 Jun 2000 02:06:47 +1000 X-Sybari-Space: 00000000 00000000 00000000 From: Andrew Morton X-Mailer: Mozilla 4.7 [en] (X11; I; Linux 2.2.14-15mdk i586) X-Accept-Language: en MIME-Version: 1.0 To: Keith Owens CC: "netdev@oss.sgi.com" Subject: Re: modular net drivers References: Your message of "Mon, 19 Jun 2000 23:54:30 +1000." <394E2616.C25F8376@uow.edu.au> <4516.961428041@ocs3.ocs-net> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-netdev@oss.sgi.com Precedence: bulk Return-Path: X-Orcpt: rfc822;netdev-outgoing Keith Owens wrote: > > Racy. The module referred to by dev->owner might be in the middle of > being unloaded. You need try_inc_mod_count() with a check on its > result instead of __MOD_INC_USE_COUNT. eww. That would mean the existing code is racy. I assumed it took care of this elsewhere. Maybe not. try_inc_mod_count looks good. Petr Vandrovec wrote: > > > You should change it to > if (dev->owner) > __MOD_INC_USE_COUNT(dev->owner); > if (dev->open) > ret = dev->open(dev); > if (ret != 0 && dev->owner) > __MOD_DEC_USE_COUNT(dev->owner); > ...