[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID:
<PAXPR07MB7984D04907E26205EA9936F8A35CA@PAXPR07MB7984.eurprd07.prod.outlook.com>
Date: Tue, 22 Jul 2025 10:04:39 +0000
From: "Chia-Yu Chang (Nokia)" <chia-yu.chang@...ia-bell-labs.com>
To: Jakub Kicinski <kuba@...nel.org>
CC: "alok.a.tiwari@...cle.com" <alok.a.tiwari@...cle.com>,
"pctammela@...atatu.com" <pctammela@...atatu.com>, "horms@...nel.org"
<horms@...nel.org>, "donald.hunter@...il.com" <donald.hunter@...il.com>,
"xandfury@...il.com" <xandfury@...il.com>, "netdev@...r.kernel.org"
<netdev@...r.kernel.org>, "dave.taht@...il.com" <dave.taht@...il.com>,
"pabeni@...hat.com" <pabeni@...hat.com>, "jhs@...atatu.com"
<jhs@...atatu.com>, "stephen@...workplumber.org"
<stephen@...workplumber.org>, "xiyou.wangcong@...il.com"
<xiyou.wangcong@...il.com>, "jiri@...nulli.us" <jiri@...nulli.us>,
"davem@...emloft.net" <davem@...emloft.net>, "edumazet@...gle.com"
<edumazet@...gle.com>, "andrew+netdev@...n.ch" <andrew+netdev@...n.ch>,
"ast@...erby.net" <ast@...erby.net>, "liuhangbin@...il.com"
<liuhangbin@...il.com>, "shuah@...nel.org" <shuah@...nel.org>,
"linux-kselftest@...r.kernel.org" <linux-kselftest@...r.kernel.org>,
"ij@...nel.org" <ij@...nel.org>, "ncardwell@...gle.com"
<ncardwell@...gle.com>, "Koen De Schepper (Nokia)"
<koen.de_schepper@...ia-bell-labs.com>, "g.white@...lelabs.com"
<g.white@...lelabs.com>, "ingemar.s.johansson@...csson.com"
<ingemar.s.johansson@...csson.com>, "mirja.kuehlewind@...csson.com"
<mirja.kuehlewind@...csson.com>, "cheshire@...le.com" <cheshire@...le.com>,
"rs.ietf@....at" <rs.ietf@....at>, "Jason_Livingood@...cast.com"
<Jason_Livingood@...cast.com>, "vidhi_goel@...le.com" <vidhi_goel@...le.com>
Subject: RE: [PATCH v25 net-next 1/6] sched: Struct definition and parsing of
dualpi2 qdisc
> -----Original Message-----
> From: Jakub Kicinski <kuba@...nel.org>
> Sent: Tuesday, July 22, 2025 2:53 AM
> To: Chia-Yu Chang (Nokia) <chia-yu.chang@...ia-bell-labs.com>
> Cc: alok.a.tiwari@...cle.com; pctammela@...atatu.com; horms@...nel.org; donald.hunter@...il.com; xandfury@...il.com; netdev@...r.kernel.org; dave.taht@...il.com; pabeni@...hat.com; jhs@...atatu.com; stephen@...workplumber.org; xiyou.wangcong@...il.com; jiri@...nulli.us; davem@...emloft.net; edumazet@...gle.com; andrew+netdev@...n.ch; ast@...erby.net; liuhangbin@...il.com; shuah@...nel.org; linux-kselftest@...r.kernel.org; ij@...nel.org; ncardwell@...gle.com; Koen De Schepper (Nokia) <koen.de_schepper@...ia-bell-labs.com>; g.white@...lelabs.com; ingemar.s.johansson@...csson.com; mirja.kuehlewind@...csson.com; cheshire@...le.com; rs.ietf@....at; Jason_Livingood@...cast.com; vidhi_goel@...le.com
> Subject: Re: [PATCH v25 net-next 1/6] sched: Struct definition and parsing of dualpi2 qdisc
>
>
> CAUTION: This is an external email. Please be very careful when clicking links or opening attachments. See the URL nok.it/ext for additional information.
>
>
>
> On Sat, 19 Jul 2025 22:41:24 +0200 chia-yu.chang@...ia-bell-labs.com
> wrote:
> > + q = qdisc_priv(sch);
> > + sch_tree_lock(sch);
> > +
> > + if (tb[TCA_DUALPI2_STEP_THRESH_PKTS] && tb[TCA_DUALPI2_STEP_THRESH_US]) {
> > + NL_SET_ERR_MSG_MOD(extack, "multiple step thresh attributes");
> > + sch_tree_unlock(sch);
> > + return -EINVAL;
> > + }
>
> tb[] is local state on the stack, parsed from the netlink message (also local). You can move the:
>
> q = qdisc_priv(sch);
> sch_tree_lock(sch);
>
> lines after the check and then you won't have to unlock on the error path.
Thanks! I've fixed in the recent v26.
And the check of both step thresholds is done like below, so no unlock is needed.
err = nla_parse_nested(tb, TCA_DUALPI2_MAX, opt, dualpi2_policy,
extack);
if (err < 0)
return err;
if (tb[TCA_DUALPI2_STEP_THRESH_PKTS] && tb[TCA_DUALPI2_STEP_THRESH_US]) {
NL_SET_ERR_MSG_MOD(extack, "multiple step thresh attributes");
return -EINVAL;
}
q = qdisc_priv(sch);
sch_tree_lock(sch);
Powered by blists - more mailing lists