[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <492C4FC1.8080107@trash.net>
Date: Tue, 25 Nov 2008 20:19:29 +0100
From: Patrick McHardy <kaber@...sh.net>
To: Stephen Hemminger <shemminger@...tta.com>
CC: David Miller <davem@...emloft.net>, netdev@...r.kernel.org
Subject: Re: [PATCH 1b/2] tc: check for errors in gen_rate_estimator creation
Stephen Hemminger wrote:
> On Tue, 25 Nov 2008 20:05:46 +0100
> Patrick McHardy <kaber@...sh.net> wrote:
>
>> Stephen Hemminger wrote:
>>> The functions gen_new_estimator and gen_replace_estimator can return errors,
>>> but they were being ignored.
>>>
>>> Signed-off-by: Stephen Hemminger <shemminger@...tta.com>
>>>
>>>
>>> ---
>>> --- a/net/sched/sch_api.c 2008-11-25 10:51:47.000000000 -0800
>>> +++ b/net/sched/sch_api.c 2008-11-25 10:54:16.000000000 -0800
>>> @@ -887,6 +887,14 @@ static int qdisc_change(struct Qdisc *sc
>>> return err;
>>> }
>>>
>>> + if (tca[TCA_RATE]) {
>>> + err = gen_replace_estimator(&sch->bstats, &sch->rate_est,
>>> + qdisc_root_sleeping_lock(sch),
>>> + tca[TCA_RATE]);
>>> + if (err)
>>> + return err;
>> This appears to have the same problem as in HFSC unless I missed more
>> code movement - changes to the qdisc have already been performed.
>
> That is not fixable since both change and replace_estimator are non-unwindable,
> and either one could fail. Could split checking and initialization out of gen_new_estimator,
> but is it worth it??
Probably not. I'd suggest to not return the estimator error in
this spot instead.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists