netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Hartkopp <socketcan@hartkopp.net>
To: David Miller <davem@davemloft.net>
Cc: herbert@gondor.apana.org.au,
	Matthias Fuchs <matthias.fuchs@esd.eu>,
	netdev@vger.kernel.org, Michel Marti <mma@objectxp.com>
Subject: Re: problem with 'net: Partially allow skb destructors to be used on receive path'
Date: Wed, 02 Dec 2009 22:21:44 +0100	[thread overview]
Message-ID: <4B16DA68.3040209@hartkopp.net> (raw)
In-Reply-To: <20090623.163743.98163763.davem@davemloft.net>

David Miller wrote:
> From: Herbert Xu <herbert@gondor.apana.org.au>
> Date: Mon, 22 Jun 2009 22:56:42 +0800
> 
>> On Mon, Jun 22, 2009 at 03:44:38PM +0200, Oliver Hartkopp wrote:
>>> I tried to apply the patch on 2.6.30 also and only got some offsets (as expected).
>> Thanks for testing!
>>
>>> Do you think, it's a good idea to queue this up for 2.6.30-stable?
>> If it's OK with Dave then it's OK with me.
> 
> I've applied Herbert's patch, thanks everyone!
> 
> I'll queue it up for -stable too.

Hello Dave,

after a request from Matthias Fuchs regarding the status of this patch in
2.6.30-stable, i discovered a problem with the commit in 2.6.30-stable:

Patch discussion/history: http://patchwork.ozlabs.org/patch/28993/

The commit in mainline is correct:

http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=d55d87fdff8252d0e2f7c28c2d443aee17e9d70f

--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1250,6 +1250,7 @@ static inline int sk_has_allocations(const struct sock *sk)

 static inline void skb_set_owner_w(struct sk_buff *skb, struct sock *sk)
 {
+       skb_orphan(skb);
        skb->sk = sk;
        skb->destructor = sock_wfree;
        /*
@@ -1262,6 +1263,7 @@ static inline void skb_set_owner_w(struct sk_buff *skb,
struct sock *sk)

 static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
 {
+       skb_orphan(skb);
        skb->sk = sk;
        skb->destructor = sock_rfree;
        atomic_add(skb->truesize, &sk->sk_rmem_alloc);



But the commit in the 2.6.30-stable tree

http://git.kernel.org/?p=linux/kernel/git/stable/linux-2.6.30.y.git;a=commitdiff;h=172570a224fe66d560c097e48fca15b620c76e72

has a problem in patching include/net/sock.h:


--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -1231,6 +1231,8 @@ static inline void skb_set_owner_w(struct sk_buff *skb,
struct sock *sk)

 static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
 {
+       skb_orphan(skb);
+       skb_orphan(skb);
        skb->sk = sk;
        skb->destructor = sock_rfree;
        atomic_add(skb->truesize, &sk->sk_rmem_alloc);


The skb_orphan(skb) in skb_set_owner_w() is missing here.

Is there any chance to fix that in 2.6.30-stable?

Thanks,
Oliver


  reply	other threads:[~2009-12-02 21:21 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-06-20 13:17 problem with 'net: Partially allow skb destructors to be used on receive path' Oliver Hartkopp
2009-06-22 12:25 ` Herbert Xu
2009-06-22 13:44   ` Oliver Hartkopp
2009-06-22 14:56     ` Herbert Xu
2009-06-23 23:37       ` David Miller
2009-12-02 21:21         ` Oliver Hartkopp [this message]
2009-12-03  0:00           ` David Miller

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=4B16DA68.3040209@hartkopp.net \
    --to=socketcan@hartkopp.net \
    --cc=davem@davemloft.net \
    --cc=herbert@gondor.apana.org.au \
    --cc=matthias.fuchs@esd.eu \
    --cc=mma@objectxp.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).