Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

net: tc: improve qdisc error messages

The existing error message ("Invalid qdisc name") is confusing
because it suggests that there is no qdisc with the given name. In
fact, the name does refer to a valid qdisc, but it doesn't match
the kind of an existing qdisc being modified or replaced. The
new error message provides more detail to eliminate confusion.

Signed-off-by: John Ousterhout <ouster@cs.stanford.edu>
Acked-by: Jamal Hadi Salim <jhs@mojatatu.com>
Link: https://patch.msgid.link/20250116195642.2794-1-ouster@cs.stanford.edu
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

John Ousterhout and committed by
Jakub Kicinski
f16312b0 ba0209bd

+3 -3
+3 -3
net/sched/sch_api.c
··· 1560 1560 } 1561 1561 1562 1562 if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], q->ops->id)) { 1563 - NL_SET_ERR_MSG(extack, "Invalid qdisc name"); 1563 + NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc"); 1564 1564 return -EINVAL; 1565 1565 } 1566 1566 ··· 1670 1670 } 1671 1671 if (tca[TCA_KIND] && 1672 1672 nla_strcmp(tca[TCA_KIND], q->ops->id)) { 1673 - NL_SET_ERR_MSG(extack, "Invalid qdisc name"); 1673 + NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc"); 1674 1674 return -EINVAL; 1675 1675 } 1676 1676 if (q->flags & TCQ_F_INGRESS) { ··· 1746 1746 return -EEXIST; 1747 1747 } 1748 1748 if (tca[TCA_KIND] && nla_strcmp(tca[TCA_KIND], q->ops->id)) { 1749 - NL_SET_ERR_MSG(extack, "Invalid qdisc name"); 1749 + NL_SET_ERR_MSG(extack, "Invalid qdisc name: must match existing qdisc"); 1750 1750 return -EINVAL; 1751 1751 } 1752 1752 err = qdisc_change(q, tca, extack);