From mboxrd@z Thu Jan 1 00:00:00 1970 From: Patrick McHardy Subject: Re: [PATCH][NET_SCHED] sch_prio: class statistics printing enabled Date: Wed, 31 Jan 2007 16:06:05 +0100 Message-ID: <45C0B05D.3020101@trash.net> References: <20070131075348.GA1857@ff.dom.local> <45C09E0B.6020107@trash.net> <20070131143522.GB3521@ff.dom.local> <45C0A9A5.4080607@trash.net> <20070131150102.GA3643@ff.dom.local> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: netdev@vger.kernel.org To: Jarek Poplawski Return-path: Received: from stinky.trash.net ([213.144.137.162]:64186 "EHLO stinky.trash.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933330AbXAaPGH (ORCPT ); Wed, 31 Jan 2007 10:06:07 -0500 In-Reply-To: <20070131150102.GA3643@ff.dom.local> Sender: netdev-owner@vger.kernel.org List-Id: netdev.vger.kernel.org Jarek Poplawski wrote: >>>From sch_api.c: > > >> if (cl_ops->dump && cl_ops->dump(q, cl, skb, tcm) < 0) >> goto rtattr_failure; >> >> if (gnet_stats_start_copy_compat(skb, TCA_STATS2, TCA_STATS, >> TCA_XSTATS, q->stats_lock, &d) < 0) >> goto rtattr_failure; >> >> if (cl_ops->dump_stats && cl_ops->dump_stats(q, cl, &d) < 0) >> goto rtattr_failure; > > > I can't see any difference between calling ->dump and > ->dump_stats? Of course we may forsee this error should > jump over cl_ops... Why should there be a difference? The class passed to both ->dump and ->dump_stats is not a classid but a qdisc-internal identifier (pointer, integer, whatever) which comes from either ->get or ->walk, and thus is valid unless these functions have bugs. Your check would cover the bug up and has no other purpose.