Skip to contentSkip to conversation

net: sched: couple of small fixes

PATCH In review Jiri Pirko 3 participants 5 messages Aug 27, 2018 – Aug 28, 2018

Subsystems (3)
lore
Share & tools
lore

Jiri Pirko

author maintainer
#0 lore raw

cover net: sched: couple of small fixes

From: Jiri Pirko <[email protected]>

Jiri Pirko (2):
net: sched: fix extack error message when chain is failed to be
created
net: sched: return -ENOENT when trying to remove filter from
non-existent chain

 net/sched/cls_api.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.14.4
author maintainer
#1 lore raw

PATCH 1/2 net: sched: fix extack error message when chain is failed to be created

From: Jiri Pirko <[email protected]>

Instead "Cannot find" say "Cannot create".

Fixes c35a4acc2985 ("net: sched: cls_api: handle generic cls errors")
---
 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/cls_api.c +1 -1
index 31bd1439cf60..2d41c5b21b48 100644
@@ -1252,7 +1252,7 @@ static int tc_new_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
 	}
 	chain = tcf_chain_get(block, chain_index, true);
 	if (!chain) {
-		NL_SET_ERR_MSG(extack, "Cannot find specified filter chain");
+		NL_SET_ERR_MSG(extack, "Cannot create specified filter chain");
 		err = -ENOMEM;
 		goto errout;
 	}
Signature · 1 line
2.14.4
author maintainer
#2 lore raw

PATCH 2/2 net: sched: return -ENOENT when trying to remove filter from non-existent chain

In reply to Jiri Pirko

From: Jiri Pirko <[email protected]>

When chain 0 was implicitly created, removal of non-existent filter from chain 0 gave -ENOENT. Once chain 0 became non-implicit, the same call is giving -EINVAL. Fix this by returning -ENOENT in that case.

Fixes f71e0ca4db18 ("net: sched: Avoid implicit chain 0 creation")
---
 net/sched/cls_api.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/sched/cls_api.c +1 -1
index 2d41c5b21b48..1a67af8a6e8c 100644
@@ -1399,7 +1399,7 @@ static int tc_del_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
 			goto errout;
 		}
 		NL_SET_ERR_MSG(extack, "Cannot find specified filter chain");
-		err = -EINVAL;
+		err = -ENOENT;
 		goto errout;
 	}
 
Signature · 1 line
2.14.4
maintainer
#4 lore raw

From: Cong Wang <[email protected]>
Date: Mon, 27 Aug 2018 13:44:56 -0700

Quoted 11 lines · Jiri Pirko
Quoted 8 lines

From: Jiri Pirko <[email protected]>

Jiri Pirko (2):
net: sched: fix extack error message when chain is failed to be
created
net: sched: return -ENOENT when trying to remove filter from
non-existent chain

Series applied.