From patchwork Thu Oct 4 09:14:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Erik Hugne X-Patchwork-Id: 189071 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id C386F2C0355 for ; Thu, 4 Oct 2012 19:14:36 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753297Ab2JDJOf (ORCPT ); Thu, 4 Oct 2012 05:14:35 -0400 Received: from mailgw1.ericsson.se ([193.180.251.45]:56214 "EHLO mailgw1.ericsson.se" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752486Ab2JDJOd (ORCPT ); Thu, 4 Oct 2012 05:14:33 -0400 X-AuditID: c1b4fb2d-b7fea6d000002ccb-e4-506d53772ff7 Received: from esessmw0184.eemea.ericsson.se (Unknown_Domain [153.88.253.125]) by mailgw1.ericsson.se (Symantec Mail Security) with SMTP id CB.E3.11467.7735D605; Thu, 4 Oct 2012 11:14:31 +0200 (CEST) Received: from eerihug-hybrid.dyn.rnd.as.sw.ericsson.se (153.88.115.8) by esessmw0184.eemea.ericsson.se (153.88.115.82) with Microsoft SMTP Server id 8.3.279.1; Thu, 4 Oct 2012 11:14:31 +0200 From: To: , CC: , , Erik Hugne Subject: [PATCH] tipc: flow control should not account for sk_rcvbuf Date: Thu, 4 Oct 2012 11:14:27 +0200 Message-ID: <1349342067-27586-1-git-send-email-erik.hugne@ericsson.com> X-Mailer: git-send-email 1.7.5.4 MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrMJMWRmVeSWpSXmKPExsUyM+JvrW55cG6AQfNrG4tjC8Qsru09zmzx +Pp1Zgdmj8+b5DzWb9nKFMAUxWWTkpqTWZZapG+XwJXx89RexoL9HBVHHyxhamB8w9bFyMkh IWAi8fjeRGYIW0ziwr31QHEuDiGBU4wSm0/eYYFwDjNKrP77hwmkik1AXuL8ottgtoiAmcTS fU9YQWxmgRSJne+XAHVzcAgLuEg0zsoBCbMIqEhcftzEDmLzCrhLbNizhB1imYLEryOrWCHi ghInZz5hgRgjIXHwxQuwg4SAeu+/nM0+gZFvFpKyWUjKFjAyrWIUzk3MzEkvN9RLLcpMLi7O z9MrTt3ECAyog1t+6+5gPHVO5BCjNAeLkjgvV9J+fyGB9MSS1OzU1ILUovii0pzU4kOMTByc Ug2MXN1CxydYugQ37r4spffNznP62zlz017uvmu5ikHywONzxQ4KEp5NzOt3OzDuCtnxQMms ahfPNt176qWr769P/6y4/vMR9wMq+twL2z9K7+o+Wz2L59z0gy2dTyXNCkLT2PZHbryzvrmG a/M2dn7bzerdCeEpr+tuP5z0TVJk3prwJ7J7T1qxKLEUZyQaajEXFScCANZqRr32AQAA Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org From: Erik Hugne The TIPC flow control is design around message count, and it should not account for the sk_rcvbuf when enqueueing messages to the socket receive queue. This fixes a problem when the sk_add_backlog fails due to this check and TIPC_ERR_OVERLOAD is reported back to the sender. The sender would then drop it's side of the connection only, leaving a stale connection on the other end. Signed-off-by: Erik Hugne --- net/tipc/socket.c | 6 ++---- 1 files changed, 2 insertions(+), 4 deletions(-) diff --git a/net/tipc/socket.c b/net/tipc/socket.c index 09dc5b9..02fed90 100644 --- a/net/tipc/socket.c +++ b/net/tipc/socket.c @@ -1269,10 +1269,8 @@ static u32 dispatch(struct tipc_port *tport, struct sk_buff *buf) if (!sock_owned_by_user(sk)) { res = filter_rcv(sk, buf); } else { - if (sk_add_backlog(sk, buf, sk->sk_rcvbuf)) - res = TIPC_ERR_OVERLOAD; - else - res = TIPC_OK; + __sk_add_backlog(sk, buf); + res = TIPC_OK; } bh_unlock_sock(sk);