net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
Subsystems (3)
PATCH 1/1 net: sched: sch_api: set an error msg when qdisc_alloc_handle() fails
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 <[email protected]>
--- net/sched/sch_api.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/sched/sch_api.c +4 -2
@@ -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 ;
Signature · 1 line
2.19.2
Quoted 3 lines · On Fri, 15 Feb 2019 11:23:25 +0100 Ivan Vecera <[email protected]> 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 <[email protected]>
Quoted 1 line
Signed-off-by Ivan Vecera <[email protected]>
Reviewed-by Stefano Brivio <[email protected]>
Signature · 1 line
Stefano
From: Ivan Vecera <[email protected]>
Date: Fri, 15 Feb 2019 11:23:25 +0100
Quoted 5 lines
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 <[email protected]>
Applied, thanks.