lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1330675173-18968-1-git-send-email-slyich@gmail.com>
Date:	Fri,  2 Mar 2012 10:59:33 +0300
From:	Sergei Trofimovich <slyich@...il.com>
To:	linux-kernel@...r.kernel.org
Cc:	netdev@...r.kernel.org, Sergei Trofimovich <slyfox@...too.org>,
	Jason Wang <jasowang@...hat.com>,
	Glauber Costa <glommer@...allels.com>,
	"David S. Miller" <davem@...emloft.net>
Subject: [PATCHv 2] tcp: properly initialize tcp memory limits part 2 (fix nfs regression)

From: Sergei Trofimovich <slyfox@...too.org>

The commit c43b874d5d7 introduced NFS file transfer hangup (proved by bisection).
> Commit 4acb4190 tries to fix the using uninitialized value
> introduced by commit 3dc43e3,  but it would make the
> per-socket memory limits too small.
>
> This patch fixes this and also remove the redundant codes
> introduced in 4acb4190.

The change looks like a typo (division flipped to multiplication):
> limit = nr_free_buffer_pages() / 8;
> limit = nr_free_buffer_pages() << (PAGE_SHIFT - 10);

Patch restores division.

CC: Jason Wang <jasowang@...hat.com>
CC: Glauber Costa <glommer@...allels.com>
CC: David S. Miller <davem@...emloft.net>
Signed-off-by: Sergei Trofimovich <slyfox@...too.org>
Tested-by: Sergei Trofimovich <slyfox@...too.org>
---

Change since v1: added forgotten commit ID

 net/ipv4/tcp.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
index 22ef5f9..b11667b 100644
--- a/net/ipv4/tcp.c
+++ b/net/ipv4/tcp.c
@@ -3299,7 +3299,7 @@ void __init tcp_init(void)
 
 	tcp_init_mem(&init_net);
 	/* Set per-socket limits to no more than 1/128 the pressure threshold */
-	limit = nr_free_buffer_pages() << (PAGE_SHIFT - 10);
+	limit = nr_free_buffer_pages() >> (PAGE_SHIFT - 10);
 	limit = max(limit, 128UL);
 	max_share = min(4UL*1024*1024, limit);
 
-- 
1.7.8.5

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ