netdev
[Top] [All Lists]

[PATCH 2/8] netpoll: deadlock bugfix

To: Andrew Morton <akpm@xxxxxxxx>, "David S. Miller" <davem@xxxxxxxxxxxxx>
Subject: [PATCH 2/8] netpoll: deadlock bugfix
From: Matt Mackall <mpm@xxxxxxxxxxx>
Date: Thu, 11 Aug 2005 21:19:10 -0500
Cc: ak@xxxxxxx, Jeff Moyer <jmoyer@xxxxxxxxxx>, netdev@xxxxxxxxxxx, linux-kernel@xxxxxxxxxxxxxxx, mingo@xxxxxxx, john.ronciak@xxxxxxxxx, rostedt@xxxxxxxxxxx
In-reply-to: <2.502409567@selenic.com>
Sender: netdev-bounce@xxxxxxxxxxx
This fixes an obvious deadlock in the netpoll code.  netpoll_rx takes the
npinfo->rx_lock.  netpoll_rx is also the only caller of arp_reply (through
__netpoll_rx).  As such, it is not necessary to take this lock.

Signed-off-by: Jeff Moyer <jmoyer@xxxxxxxxxx>
Signed-off-by: Matt Mackall <mpm@xxxxxxxxxxx>

Index: l/net/core/netpoll.c
===================================================================
--- l.orig/net/core/netpoll.c   2005-08-06 17:47:48.000000000 -0500
+++ l/net/core/netpoll.c        2005-08-06 17:47:49.000000000 -0500
@@ -353,11 +353,8 @@ static void arp_reply(struct sk_buff *sk
        struct sk_buff *send_skb;
        struct netpoll *np = NULL;
 
-       spin_lock_irqsave(&npinfo->rx_lock, flags);
        if (npinfo->rx_np && npinfo->rx_np->dev == skb->dev)
                np = npinfo->rx_np;
-       spin_unlock_irqrestore(&npinfo->rx_lock, flags);
-
        if (!np)
                return;
 

<Prev in Thread] Current Thread [Next in Thread>