All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
@ 2019-02-15 10:23 Ivan Vecera
  2019-02-15 10:30 ` Stefano Brivio
  2019-02-17 23:39 ` David Miller
  0 siblings, 2 replies; 3+ messages in thread
From: Ivan Vecera @ 2019-02-15 10:23 UTC (permalink / raw)
  To: netdev

This patch sets an error message in extack when the number of qdisc
handles exceeds the maximum. Also the error-code ENOSPC is more
appropriate than ENOMEM in this situation.

Signed-off-by: Ivan Vecera <ivecera@redhat.com>
---
 net/sched/sch_api.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/net/sched/sch_api.c b/net/sched/sch_api.c
index 2283924fb56d..b8a388e4bcc4 100644
--- a/net/sched/sch_api.c
+++ b/net/sched/sch_api.c
@@ -1201,9 +1201,11 @@ static struct Qdisc *qdisc_create(struct net_device *dev,
 	} else {
 		if (handle == 0) {
 			handle = qdisc_alloc_handle(dev);
-			err = -ENOMEM;
-			if (handle == 0)
+			if (handle == 0) {
+				NL_SET_ERR_MSG(extack, "Maximum number of qdisc handles was exceeded");
+				err = -ENOSPC;
 				goto err_out3;
+			}
 		}
 		if (!netif_is_multiqueue(dev))
 			sch->flags |= TCQ_F_ONETXQUEUE;
-- 
2.19.2


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
  2019-02-15 10:23 [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails Ivan Vecera
@ 2019-02-15 10:30 ` Stefano Brivio
  2019-02-17 23:39 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: Stefano Brivio @ 2019-02-15 10:30 UTC (permalink / raw)
  To: Ivan Vecera; +Cc: netdev, Li Shuang

On Fri, 15 Feb 2019 11:23:25 +0100
Ivan Vecera <ivecera@redhat.com> wrote:

> This patch sets an error message in extack when the number of qdisc
> handles exceeds the maximum. Also the error-code ENOSPC is more
> appropriate than ENOMEM in this situation.

Reported-by: Li Shuang <shuali@redhat.com>

> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Reviewed-by: Stefano Brivio <sbrivio@redhat.com>

-- 
Stefano

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
  2019-02-15 10:23 [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails Ivan Vecera
  2019-02-15 10:30 ` Stefano Brivio
@ 2019-02-17 23:39 ` David Miller
  1 sibling, 0 replies; 3+ messages in thread
From: David Miller @ 2019-02-17 23:39 UTC (permalink / raw)
  To: ivecera; +Cc: netdev

From: Ivan Vecera <ivecera@redhat.com>
Date: Fri, 15 Feb 2019 11:23:25 +0100

> This patch sets an error message in extack when the number of qdisc
> handles exceeds the maximum. Also the error-code ENOSPC is more
> appropriate than ENOMEM in this situation.
> 
> Signed-off-by: Ivan Vecera <ivecera@redhat.com>

Applied, thanks.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-02-17 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-15 10:23 [PATCH net-next] net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails Ivan Vecera
2019-02-15 10:30 ` Stefano Brivio
2019-02-17 23:39 ` David Miller

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.