Subject: Re: [PATCH] Re: netconsole still hangs

From: Andrew Morton <[email-masked]>
Date: Mon, 17 Mar 2008 16:12:22 -0700

On Sat, 15 Mar 2008 00:47:49 +0100
Jarek Poplawski <[email-masked]> wrote:

> [NETPOLL] zap_completion_queue: adjust skb->users counter
> 
> zap_completion_queue() retrieves skbs from completion_queue where they
> have zero skb->users counter. Before dev_kfree_skb_any() it should be
> non-zero yet, so it's increased now.
> 
> 
> Reported-and-tested-by: Andrew Morton <[email-masked]>
> Signed-off-by: Jarek Poplawski <[email-masked]>
> 
> (not tested)
> ---
> 
>  net/core/netpoll.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/net/core/netpoll.c b/net/core/netpoll.c
> index d0c8bf5..b04d643 100644
> --- a/net/core/netpoll.c
> +++ b/net/core/netpoll.c
> @@ -215,10 +215,12 @@ static void zap_completion_queue(void)
>  		while (clist != NULL) {
>  			struct sk_buff *skb = clist;
>  			clist = clist->next;
> -			if (skb->destructor)
> +			if (skb->destructor) {
> +				atomic_inc(&skb->users);
>  				dev_kfree_skb_any(skb); /* put this one back */
> -			else
> +			} else {
>  				__kfree_skb(skb);
> +			}
>  		}
>  	}

I retested.  This patch doesn't appear to make anything worse, but the hang
is still there.