]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - net/sched/cls_matchall.c
Merge tag 'scsi-sg' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux.git] / net / sched / cls_matchall.c
index 38c0a9f0f2961f598a83e330c6ef26cd6345193a..a30d2f8feb32369da58dee646fb84c88b4ab3b18 100644 (file)
@@ -21,6 +21,7 @@ struct cls_mall_head {
        unsigned int in_hw_count;
        struct tc_matchall_pcnt __percpu *pf;
        struct rcu_work rwork;
+       bool deleting;
 };
 
 static int mall_classify(struct sk_buff *skb, const struct tcf_proto *tp,
@@ -258,7 +259,11 @@ static int mall_change(struct net *net, struct sk_buff *in_skb,
 static int mall_delete(struct tcf_proto *tp, void *arg, bool *last,
                       bool rtnl_held, struct netlink_ext_ack *extack)
 {
-       return -EOPNOTSUPP;
+       struct cls_mall_head *head = rtnl_dereference(tp->root);
+
+       head->deleting = true;
+       *last = true;
+       return 0;
 }
 
 static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg,
@@ -269,7 +274,7 @@ static void mall_walk(struct tcf_proto *tp, struct tcf_walker *arg,
        if (arg->count < arg->skip)
                goto skip;
 
-       if (!head)
+       if (!head || head->deleting)
                return;
        if (arg->fn(tp, head, arg) < 0)
                arg->stop = 1;