All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <shemminger@osdl.org>
To: Jarek Poplawski <jarkao2@o2.pl>
Cc: netdev@vger.kernel.org, "David S\. Miller" <davem@davemloft.net>
Subject: Re: [PATCH 2.6.19-rc4-git10][PKT_SCHED] sch_htb: INIT_HLIST_NODE after hlist_del()
Date: Mon, 6 Nov 2006 09:44:49 -0800	[thread overview]
Message-ID: <20061106094449.3b8253b9@freekitty> (raw)
In-Reply-To: <20061106113353.GA4829@ff.dom.local>

On Mon, 6 Nov 2006 12:33:53 +0100
Jarek Poplawski <jarkao2@o2.pl> wrote:

> After hlist_del() next and pprev pointers are not NULL
> so hlist_unhashed() doesn't work properly.
> 
> 
> Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
> ---
> 
> 
> diff -Nurp linux-2.6.19-rc4-git10-/net/sched/sch_htb.c linux-2.6.19-rc4-git10/net/sched/sch_htb.c
> --- linux-2.6.19-rc4-git10-/net/sched/sch_htb.c	2006-11-06 11:42:41.000000000 +0100
> +++ linux-2.6.19-rc4-git10/net/sched/sch_htb.c	2006-11-06 11:53:15.000000000 +0100
> @@ -1284,8 +1284,10 @@ static void htb_destroy_class(struct Qdi
>  						  struct htb_class, sibling));
>  
>  	/* note: this delete may happen twice (see htb_delete) */
> -	if (!hlist_unhashed(&cl->hlist))
> +	if (!hlist_unhashed(&cl->hlist)) {
>  		hlist_del(&cl->hlist);
> +		INIT_HLIST_NODE(&cl->hlist);
> +	}

why not use hlist_del_init?

>  	list_del(&cl->sibling);
>  
>  	if (cl->prio_activity)
> @@ -1333,8 +1335,10 @@ static int htb_delete(struct Qdisc *sch,
>  	sch_tree_lock(sch);
>  
>  	/* delete from hash and active; remainder in destroy_class */
> -	if (!hlist_unhashed(&cl->hlist))
> +	if (!hlist_unhashed(&cl->hlist)) {
>  		hlist_del(&cl->hlist);
> +		INIT_HLIST_NODE(&cl->hlist);
> +	}
>  
>  	if (cl->prio_activity)
>  		htb_deactivate(q, cl);


-- 
Stephen Hemminger <shemminger@osdl.org>

  reply	other threads:[~2006-11-06 17:44 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-06 11:33 [PATCH 2.6.19-rc4-git10][PKT_SCHED] sch_htb: INIT_HLIST_NODE after hlist_del() Jarek Poplawski
2006-11-06 17:44 ` Stephen Hemminger [this message]
2006-11-07  6:49   ` Jarek Poplawski
2006-11-07 17:50     ` Stephen Hemminger
2006-11-07 22:55       ` David Miller
2006-11-08  6:36       ` Jarek Poplawski

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=20061106094449.3b8253b9@freekitty \
    --to=shemminger@osdl.org \
    --cc=davem@davemloft.net \
    --cc=jarkao2@o2.pl \
    --cc=netdev@vger.kernel.org \
    /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 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.