From patchwork Thu Sep 11 13:51:48 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Eckelmann X-Patchwork-Id: 5330 Received: from john.hrz.tu-chemnitz.de (john.hrz.tu-chemnitz.de [134.109.132.2]) by open-mesh.net (8.13.4/8.13.4/Debian-3sarge3) with ESMTP id m8BDu8hN032278 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NOT) for ; Thu, 11 Sep 2008 15:56:09 +0200 Received: from galba.hrz.tu-chemnitz.de ([134.109.133.156] helo=mailbox.hrz.tu-chemnitz.de) by john.hrz.tu-chemnitz.de with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1KdmaI-00066w-4N for b.a.t.m.a.n@open-mesh.net; Thu, 11 Sep 2008 15:51:46 +0200 Received: from vpnclient-076.hrz.tu-chemnitz.de ([134.109.232.76] helo=sven-desktop) by mailbox.hrz.tu-chemnitz.de with smtp (Exim 4.69) (envelope-from ) id 1KdmaH-0008OJ-RN for b.a.t.m.a.n@open-mesh.net; Thu, 11 Sep 2008 15:51:46 +0200 Received: by sven-desktop (nbSMTP-1.00) for uid 1000 sven.eckelmann@gmx.de; Thu, 11 Sep 2008 15:51:49 +0200 (CEST) Date: Thu, 11 Sep 2008 15:51:48 +0200 From: Sven Eckelmann To: b.a.t.m.a.n@open-mesh.net Message-ID: <20080911135148.GA21632@sven-desktop.lazhur.ath.cx> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) X-Scan-Signature: 85efea2434610bb461976c4d7ea3ef3f Subject: [B.A.T.M.A.N.] [PATCH] Unlock all spinlocks in batgat X-BeenThere: b.a.t.m.a.n@open-mesh.net X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The list for a Better Approach To Mobile Ad-hoc Networking List-Id: The list for a Better Approach To Mobile Ad-hoc Networking List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2008 13:56:09 -0000 We leave get_ip_addr when a client was found in hash immediately, but have have spinlocked hash_lock before. Spinlocks on non smp kernels are simple nops which only disable peempt (only on peempt enabled kernels) and so will never lock anything and no dead(spin)lock will happen. More informations about this issue can be found in "Unreliable Guide To Locking" under the section "Locks and Uniprocessor Kernels". Signed-off-by: Sven Eckelmann --- batman/linux/modules/gateway.c | 1 + batman/linux/modules/gateway24.c | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/batman/linux/modules/gateway.c b/batman/linux/modules/gateway.c index 999d3e6..5786be8 100644 --- a/batman/linux/modules/gateway.c +++ b/batman/linux/modules/gateway.c @@ -645,6 +645,7 @@ static struct gw_client *get_ip_addr(struct sockaddr_in *client_addr) if (gw_client != NULL) { DBG("found client in hash"); + spin_unlock(&hash_lock); return gw_client; } diff --git a/batman/linux/modules/gateway24.c b/batman/linux/modules/gateway24.c index 48f31a7..44dfc0e 100644 --- a/batman/linux/modules/gateway24.c +++ b/batman/linux/modules/gateway24.c @@ -587,6 +587,7 @@ static struct gw_client *get_ip_addr(struct sockaddr_in *client_addr) if (gw_client != NULL) { printk(KERN_DEBUG "found client in hash"); + spin_unlock(&hash_lock); return gw_client; }