From: Tommy Christensen <tommy.christensen@tpack.net>
To: Herbert Xu <herbert@gondor.apana.org.au>
Cc: Ken-ichirou MATSUZAWA <chamas@h4.dion.ne.jp>,
netdev@oss.sgi.com, "David S. Miller" <davem@davemloft.net>
Subject: Re: assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122)
Date: Thu, 12 May 2005 11:58:07 +0200 [thread overview]
Message-ID: <1115891887.30106.89.camel@tsc-6.cph.tpack.net> (raw)
In-Reply-To: <20050511231751.GA21781@gondor.apana.org.au>
[-- Attachment #1: Type: text/plain, Size: 269 bytes --]
On Thu, 2005-05-12 at 01:17, Herbert Xu wrote:
> BTW, we could also move the skb_orphan to the skb_get path since the
> cloned packets don't need the orphan call.
Yes, I like this better. Good idea.
Signed-off-by: Tommy S. Christensen <tommy.christensen@tpack.net>
[-- Attachment #2: Type: text/x-patch, Size: 687 bytes --]
diff -ru linux-2.6.12-rc4/net/netlink/af_netlink.c linux-2.6.12-work/net/netlink/af_netlink.c
--- linux-2.6.12-rc4/net/netlink/af_netlink.c 2005-05-11 11:10:20.000000000 +0200
+++ linux-2.6.12-work/net/netlink/af_netlink.c 2005-05-12 11:51:57.427312857 +0200
@@ -735,11 +735,13 @@
sock_hold(sk);
if (p->skb2 == NULL) {
- if (atomic_read(&p->skb->users) != 1) {
+ if (skb_shared(p->skb)) {
p->skb2 = skb_clone(p->skb, p->allocation);
} else {
- p->skb2 = p->skb;
- atomic_inc(&p->skb->users);
+ p->skb2 = skb_get(p->skb);
+ /* skb ownership may have been set when
+ delivered to a previous socket. */
+ skb_orphan(p->skb2);
}
}
if (p->skb2 == NULL) {
next prev parent reply other threads:[~2005-05-12 9:58 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-10 12:43 assertion (!atomic_read(&sk->sk_rmem_alloc)) failed at net/netlink/af_netlink.c (122) Ken-ichirou MATSUZAWA
2005-05-10 22:07 ` Herbert Xu
2005-05-11 0:58 ` Herbert Xu
2005-05-11 15:20 ` Ken-ichirou MATSUZAWA
2005-05-11 22:17 ` Tommy Christensen
2005-05-11 22:22 ` Herbert Xu
2005-05-19 19:47 ` David S. Miller
2005-05-11 23:17 ` Herbert Xu
2005-05-12 9:58 ` Tommy Christensen [this message]
2005-05-12 10:42 ` Herbert Xu
2005-05-12 10:58 ` Tommy Christensen
2005-05-12 11:07 ` Herbert Xu
2005-05-19 19:49 ` David S. Miller
2005-05-19 21:34 ` Herbert Xu
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=1115891887.30106.89.camel@tsc-6.cph.tpack.net \
--to=tommy.christensen@tpack.net \
--cc=chamas@h4.dion.ne.jp \
--cc=davem@davemloft.net \
--cc=herbert@gondor.apana.org.au \
--cc=netdev@oss.sgi.com \
/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).