From patchwork Mon Sep 14 08:35:44 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jarek Poplawski X-Patchwork-Id: 33569 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id 45844B7B3E for ; Mon, 14 Sep 2009 18:35:58 +1000 (EST) Received: by ozlabs.org (Postfix) id 3353BDDD0C; Mon, 14 Sep 2009 18:35:58 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id CF901DDD0B for ; Mon, 14 Sep 2009 18:35:57 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755145AbZINIfu (ORCPT ); Mon, 14 Sep 2009 04:35:50 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754586AbZINIft (ORCPT ); Mon, 14 Sep 2009 04:35:49 -0400 Received: from mail-fx0-f217.google.com ([209.85.220.217]:49180 "EHLO mail-fx0-f217.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754471AbZINIfs (ORCPT ); Mon, 14 Sep 2009 04:35:48 -0400 Received: by fxm17 with SMTP id 17so669851fxm.37 for ; Mon, 14 Sep 2009 01:35:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:date:from:to:cc:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=lBp/6ZojdVJCo86q6CekWCKUL1Q8rlHFz9ey16g+dk8=; b=lDsbfzqn34LArz7ft4iMYFwlBI+bdHA9eWOdPkHVqIH0gFLJU/VcJIjOwHn6dTtdmC qWIoUcyvNgzW1bOCoHiD8/5n9wcf3sy2KFanKvvnz8q3QC9wPZUAl//OuqxHwQ5rGT9q RIQs8fg1hyHRm9uXe1yTjHcWAZzVGr/7IiY9A= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=date:from:to:cc:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=C2C8N+5/A2Hv8v4d8Kq4HO0ZU5QDRwEb17dga+BHdEaSWyx3B4DMq7aGoBpeWArA7g 9Rf/FGDN4i1VCVY+4m7zg1G6LhvssgeEd6bhMQq+kh4xBisBRYqJiZb29GBGy2MC+M1J LAGq6WXzgJXhNLZIWz8/ZUTg7iINceOLwyo7c= Received: by 10.204.7.197 with SMTP id e5mr4926547bke.184.1252917351084; Mon, 14 Sep 2009 01:35:51 -0700 (PDT) Received: from ff.dom.local (bv170.internetdsl.tpnet.pl [80.53.205.170]) by mx.google.com with ESMTPS id e17sm756019fke.32.2009.09.14.01.35.48 (version=SSLv3 cipher=RC4-MD5); Mon, 14 Sep 2009 01:35:49 -0700 (PDT) Date: Mon, 14 Sep 2009 08:35:44 +0000 From: Jarek Poplawski To: David Miller Cc: Patrick McHardy , netdev@vger.kernel.org Subject: [PATCH] pkt_sched: Fix qdisc_graft WRT ingress qdisc Message-ID: <20090914083544.GA10444@ff.dom.local> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.18 (2008-05-17) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org After the recent mq change using ingress qdisc overwrites dev->qdisc; there is also a wrong old qdisc pointer passed to notify_and_destroy. Signed-off-by: Jarek Poplawski --- net/sched/sch_api.c | 15 ++++++++++----- 1 files changed, 10 insertions(+), 5 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c index 3af1061..c5a6d62 100644 --- a/net/sched/sch_api.c +++ b/net/sched/sch_api.c @@ -693,13 +693,18 @@ static int qdisc_graft(struct net_device *dev, struct Qdisc *parent, if (new && i > 0) atomic_inc(&new->refcnt); - qdisc_destroy(old); + if (!ingress) + qdisc_destroy(old); } - notify_and_destroy(skb, n, classid, dev->qdisc, new); - if (new && !new->ops->attach) - atomic_inc(&new->refcnt); - dev->qdisc = new ? : &noop_qdisc; + if (!ingress) { + notify_and_destroy(skb, n, classid, dev->qdisc, new); + if (new && !new->ops->attach) + atomic_inc(&new->refcnt); + dev->qdisc = new ? : &noop_qdisc; + } else { + notify_and_destroy(skb, n, classid, old, new); + } if (dev->flags & IFF_UP) dev_activate(dev);