Netdev List
 help / color / mirror / Atom feed
From: Pedro Tammela <pctammela@mojatatu.com>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org,
	pabeni@redhat.com, jhs@mojatatu.com, xiyou.wangcong@gmail.com,
	jiri@resnulli.us, Pedro Tammela <pctammela@mojatatu.com>
Subject: [PATCH net-next 3/5] net/sched: sch_hfsc: warn about class in use while deleting
Date: Fri, 21 Jul 2023 16:13:30 -0300	[thread overview]
Message-ID: <20230721191332.1424997-4-pctammela@mojatatu.com> (raw)
In-Reply-To: <20230721191332.1424997-1-pctammela@mojatatu.com>

Add extack to warn that delete was rejected because
the class is still in use

Signed-off-by: Pedro Tammela <pctammela@mojatatu.com>
---
 net/sched/sch_hfsc.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c
index 122fe775c7ab..4800191f7c49 100644
--- a/net/sched/sch_hfsc.c
+++ b/net/sched/sch_hfsc.c
@@ -1095,8 +1095,10 @@ hfsc_delete_class(struct Qdisc *sch, unsigned long arg,
 	struct hfsc_class *cl = (struct hfsc_class *)arg;
 
 	if (cl->level > 0 || qdisc_class_in_use(&cl->cl_common) ||
-	    cl == &q->root)
+	    cl == &q->root) {
+		NL_SET_ERR_MSG(extack, "HFSC class in use");
 		return -EBUSY;
+	}
 
 	sch_tree_lock(sch);
 
-- 
2.39.2


  parent reply	other threads:[~2023-07-21 19:14 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-21 19:13 [PATCH net-next 0/5] net/sched: improve class lifetime handling Pedro Tammela
2023-07-21 19:13 ` [PATCH net-next 1/5] net/sched: wrap open coded Qdics class filter counter Pedro Tammela
2023-07-23 18:10   ` Cong Wang
2023-07-24 17:05     ` Pedro Tammela
2023-07-21 19:13 ` [PATCH net-next 2/5] net/sched: sch_drr: warn about class in use while deleting Pedro Tammela
2023-07-21 19:13 ` Pedro Tammela [this message]
2023-07-21 19:13 ` [PATCH net-next 4/5] net/sched: sch_htb: " Pedro Tammela
2023-07-21 19:13 ` [PATCH net-next 5/5] net/sched: sch_qfq: " Pedro Tammela
2023-07-22 12:41 ` [PATCH net-next 0/5] net/sched: improve class lifetime handling Jamal Hadi Salim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230721191332.1424997-4-pctammela@mojatatu.com \
    --to=pctammela@mojatatu.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox