Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=e1e992e52faa588667e1378a2573b4b8e3fa6670
Commit:     e1e992e52faa588667e1378a2573b4b8e3fa6670
Parent:     4878809f711981a602cc562eb47994fc81ea0155
Author:     Jamal Hadi Salim <[EMAIL PROTECTED]>
AuthorDate: Wed Sep 12 16:32:59 2007 +0200
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Fri Sep 14 16:43:05 2007 -0700

    [NET_SCHED] protect action config/dump from irqs
    
    (with no apologies to C Heston)
    
    On Mon, 2007-10-09 at 21:00 +0800, Herbert Xu wrote:
    On Sun, Sep 02, 2007 at 01:11:29PM +0000, Christian Kujau wrote:
    > >
    > > after upgrading to 2.6.23-rc5 (and applying davem's fix [0]), lockdep
    > > was quite noisy when I tried to shape my external (wireless) interface:
    > >
    > > [ 6400.534545] FahCore_78.exe/3552 just changed the state of lock:
    > > [ 6400.534713]  (&dev->ingress_lock){-+..}, at: [<c038d595>]
    > > netif_receive_skb+0x2d5/0x3c0
    > > [ 6400.534941] but this lock took another, soft-read-irq-unsafe lock in 
the
    > > past:
    > > [ 6400.535145]  (police_lock){-.--}
    >
    > This is a genuine dead-lock.  The police lock can be taken
    > for reading with softirqs on.  If a second CPU tries to take
    > the police lock for writing, while holding the ingress lock,
    > then a softirq on the first CPU can dead-lock when it tries
    > to get the ingress lock.
    
    Signed-off-by: Jamal Hadi Salim <[EMAIL PROTECTED]>
    Acked-by: Herbert Xu <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 net/sched/act_api.c    |    8 ++++----
 net/sched/act_police.c |    4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/net/sched/act_api.c b/net/sched/act_api.c
index feef366..72cdb0f 100644
--- a/net/sched/act_api.c
+++ b/net/sched/act_api.c
@@ -68,7 +68,7 @@ static int tcf_dump_walker(struct sk_buff *skb, struct 
netlink_callback *cb,
        int err = 0, index = -1,i = 0, s_i = 0, n_i = 0;
        struct rtattr *r ;
 
-       read_lock(hinfo->lock);
+       read_lock_bh(hinfo->lock);
 
        s_i = cb->args[0];
 
@@ -96,7 +96,7 @@ static int tcf_dump_walker(struct sk_buff *skb, struct 
netlink_callback *cb,
                }
        }
 done:
-       read_unlock(hinfo->lock);
+       read_unlock_bh(hinfo->lock);
        if (n_i)
                cb->args[0] += n_i;
        return n_i;
@@ -156,13 +156,13 @@ struct tcf_common *tcf_hash_lookup(u32 index, struct 
tcf_hashinfo *hinfo)
 {
        struct tcf_common *p;
 
-       read_lock(hinfo->lock);
+       read_lock_bh(hinfo->lock);
        for (p = hinfo->htab[tcf_hash(index, hinfo->hmask)]; p;
             p = p->tcfc_next) {
                if (p->tcfc_index == index)
                        break;
        }
-       read_unlock(hinfo->lock);
+       read_unlock_bh(hinfo->lock);
 
        return p;
 }
diff --git a/net/sched/act_police.c b/net/sched/act_police.c
index 6085be5..17f6f27 100644
--- a/net/sched/act_police.c
+++ b/net/sched/act_police.c
@@ -56,7 +56,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct 
netlink_callback *c
        int err = 0, index = -1, i = 0, s_i = 0, n_i = 0;
        struct rtattr *r;
 
-       read_lock(&police_lock);
+       read_lock_bh(&police_lock);
 
        s_i = cb->args[0];
 
@@ -85,7 +85,7 @@ static int tcf_act_police_walker(struct sk_buff *skb, struct 
netlink_callback *c
                }
        }
 done:
-       read_unlock(&police_lock);
+       read_unlock_bh(&police_lock);
        if (n_i)
                cb->args[0] += n_i;
        return n_i;
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to