public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Ed Cashin <ecashin@coraid.com>
Cc: dan.carpenter@oracle.com, kernel-janitors@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] aoe: avoid using skb member after dev_queue_xmit
Date: Wed, 24 Oct 2012 15:08:07 -0700	[thread overview]
Message-ID: <20121024150807.82ce2677.akpm@linux-foundation.org> (raw)
In-Reply-To: <d1523cdc8a606d65418dc242e958ff1c@coraid.com>

On Wed, 24 Oct 2012 14:26:13 -0400
Ed Cashin <ecashin@coraid.com> wrote:

> After calling dev_queue_xmit it is no longer safe to access the
> members of the skb.
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

hm, that was clever.  How did Dan detect this bug?

> --- a/drivers/block/aoe/aoenet.c
> +++ b/drivers/block/aoe/aoenet.c
> @@ -55,12 +55,14 @@ static int
>  tx(void) __must_hold(&txlock)
>  {
>  	struct sk_buff *skb;
> +	struct net_device *ifp;
>  
>  	while ((skb = skb_dequeue(&skbtxq))) {
>  		spin_unlock_irq(&txlock);
> +		ifp = skb->dev;
>  		if (dev_queue_xmit(skb) == NET_XMIT_DROP && net_ratelimit())
>  			pr_warn("aoe: packet could not be sent on %s.  %s\n",
> -				skb->dev ? skb->dev->name : "netif",
> +				ifp ? ifp->name : "netif",
>  				"consider increasing tx_queue_len");
>  		spin_lock_irq(&txlock);
>  	}

Queued as a fix against the not-yet-upstream
aoe-print-warning-regarding-a-common-reason-for-dropped-transmits.patch,
thanks.


  reply	other threads:[~2012-10-24 22:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-24 18:26 [PATCH] aoe: avoid using skb member after dev_queue_xmit Ed Cashin, Ed Cashin
2012-10-24 22:08 ` Andrew Morton [this message]
2012-10-25  6:33   ` Dan Carpenter
2012-10-25 17:35     ` Ed Cashin

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=20121024150807.82ce2677.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=dan.carpenter@oracle.com \
    --cc=ecashin@coraid.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox