From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Jay Lan <jlan@engr.sgi.com>
Cc: Andrew Morton <akpm@osdl.org>,
Guillaume Thouvenin <guillaume.thouvenin@bull.net>,
greg@kroah.com, linux-kernel@vger.kernel.org,
efocht@hpce.nec.com, linuxram@us.ibm.com, gh@us.ibm.com,
elsa-devel@lists.sourceforge.net, aquynh@gmail.com,
dean-list-linux-kernel@arctic.org, pj@sgi.com
Subject: Re: [patch 2.6.12-rc1-mm4] fork_connector: add a fork connector
Date: Fri, 08 Apr 2005 14:24:00 +0400 [thread overview]
Message-ID: <1112955840.28858.236.camel@uganda> (raw)
In-Reply-To: <4255B868.6040600@engr.sgi.com>
[-- Attachment #1: Type: text/plain, Size: 2675 bytes --]
On Thu, 2005-04-07 at 15:47 -0700, Jay Lan wrote:
> BTW, when it happened last time, my program listening to the socket
> complained about duplicate messages received.
>
> Unmatched seq. Rcvd=1824062, expected=1824061 <===
> Unmatched seq. Rcvd=1824062, expected=1824063 <===
> Unmatched seq. Rcvd=1824348, expected=1824307
>
> When my program received 1824062 while expecting 1824061
> it adjusted itself to expect the next one being 1824063. But instead
> the message of 1824062 arrived the second time.
Thank you for your report.
Could you reproduce a bug with the attached patch?
> - jay
* looking for johnpol@2ka.mipt.ru-2004/connector--main--0--patch-38 to compare with
* comparing to johnpol@2ka.mipt.ru-2004/connector--main--0--patch-38
M connector.c
* modified files
--- orig/drivers/connector/connector.c
+++ mod/drivers/connector/connector.c
@@ -121,7 +121,7 @@
NETLINK_CB(skb).dst_groups = groups;
uskb = skb_clone(skb, GFP_ATOMIC);
- if (uskb)
+ if (uskb && 0)
netlink_unicast(dev->nls, uskb, 0, 0);
netlink_broadcast(dev->nls, skb, 0, groups, GFP_ATOMIC);
@@ -158,7 +158,7 @@
}
spin_unlock_bh(&dev->cbdev->queue_lock);
- return found;
+ return (found)?0:-ENODEV;
}
/*
@@ -181,7 +181,6 @@
"requested msg->len=%u[%u], nlh->nlmsg_len=%u, skb->len=%u.\n",
msg->len, NLMSG_SPACE(msg->len + sizeof(*msg)),
nlh->nlmsg_len, skb->len);
- kfree_skb(skb);
return -EINVAL;
}
#if 0
@@ -215,17 +214,18 @@
skb->len, skb->data_len, skb->truesize, skb->protocol,
skb_cloned(skb), skb_shared(skb));
#endif
- while (skb->len >= NLMSG_SPACE(0)) {
+ if (skb->len >= NLMSG_SPACE(0)) {
nlh = (struct nlmsghdr *)skb->data;
+
if (nlh->nlmsg_len < sizeof(struct cn_msg) ||
skb->len < nlh->nlmsg_len ||
nlh->nlmsg_len > CONNECTOR_MAX_MSG_SIZE) {
-#if 0
+#if 1
printk(KERN_INFO "nlmsg_len=%u, sizeof(*nlh)=%u\n",
nlh->nlmsg_len, sizeof(*nlh));
#endif
kfree_skb(skb);
- break;
+ goto out;
}
len = NLMSG_ALIGN(nlh->nlmsg_len);
@@ -233,22 +233,11 @@
len = skb->len;
err = __cn_rx_skb(skb, nlh);
- if (err) {
-#if 0
- if (err < 0 && (nlh->nlmsg_flags & NLM_F_ACK))
- netlink_ack(skb, nlh, -err);
-#endif
- break;
- } else {
-#if 0
- if (nlh->nlmsg_flags & NLM_F_ACK)
- netlink_ack(skb, nlh, 0);
-#endif
- break;
- }
- skb_pull(skb, len);
+ if (err < 0)
+ kfree_skb(skb);
}
-
+
+out:
kfree_skb(__skb);
}
--
Evgeniy Polyakov
Crash is better than data corruption -- Arthur Grabowski
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
next prev parent reply other threads:[~2005-04-08 10:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-31 13:59 [patch 2.6.12-rc1-mm4] fork_connector: add a fork connector Guillaume Thouvenin
2005-03-31 22:44 ` Andrew Morton
2005-04-01 0:10 ` Jay Lan
2005-04-01 7:52 ` Evgeniy Polyakov
2005-04-07 22:40 ` Jay Lan
2005-04-07 22:47 ` Jay Lan
2005-04-08 10:24 ` Evgeniy Polyakov [this message]
2005-04-08 10:52 ` Evgeniy Polyakov
2005-04-08 20:27 ` Jay Lan
2005-04-08 22:08 ` Jay Lan
2005-04-08 22:18 ` Evgeniy Polyakov
2005-04-09 3:31 ` Jay Lan
2005-04-09 6:29 ` Evgeniy Polyakov
2005-04-11 5:43 ` Jay Lan
2005-04-11 6:44 ` Evgeniy Polyakov
2005-04-11 6:51 ` Andrew Morton
2005-04-11 7:31 ` Evgeniy Polyakov
2005-03-31 22:53 ` Andrew Morton
2005-04-01 10:56 ` Guillaume Thouvenin
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=1112955840.28858.236.camel@uganda \
--to=johnpol@2ka.mipt.ru \
--cc=akpm@osdl.org \
--cc=aquynh@gmail.com \
--cc=dean-list-linux-kernel@arctic.org \
--cc=efocht@hpce.nec.com \
--cc=elsa-devel@lists.sourceforge.net \
--cc=gh@us.ibm.com \
--cc=greg@kroah.com \
--cc=guillaume.thouvenin@bull.net \
--cc=jlan@engr.sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=pj@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