[Ocfs2-commits] zab commits r2452 - trunk/fs/ocfs2/cluster
svn-commits at oss.oracle.com
svn-commits at oss.oracle.com
Fri Jul 1 14:56:55 CDT 2005
Author: zab
Signed-off-by: jlbec
Date: 2005-07-01 14:56:54 -0500 (Fri, 01 Jul 2005)
New Revision: 2452
Modified:
trunk/fs/ocfs2/cluster/tcp.c
Log:
Fixed the net perf regression introduced in rev 244 by being sure to call the
right setsockopt for tcp so that we get TCP_NODELAY instead of SO_DEBUG.
Signed-off-by: jlbec
Modified: trunk/fs/ocfs2/cluster/tcp.c
===================================================================
--- trunk/fs/ocfs2/cluster/tcp.c 2005-07-01 16:49:20 UTC (rev 2451)
+++ trunk/fs/ocfs2/cluster/tcp.c 2005-07-01 19:56:54 UTC (rev 2452)
@@ -1262,8 +1262,19 @@
oldfs = get_fs();
set_fs(KERNEL_DS);
- ret = sock_setsockopt(sock, SOL_TCP, TCP_NODELAY,
- (char __user *)&val, sizeof(val));
+ /*
+ * Dear unsuspecting programmer,
+ *
+ * Don't use sock_setsockopt() for SOL_TCP. It doesn't check its level
+ * argument and assumes SOL_SOCKET so, say, your TCP_NODELAY will
+ * silently turn into SO_DEBUG.
+ *
+ * Yours,
+ * Keeper of hilariously fragile interfaces.
+ */
+ ret = sock->ops->setsockopt(sock, SOL_TCP, TCP_NODELAY,
+ (char __user *)&val, sizeof(val));
+
set_fs(oldfs);
return ret;
}
More information about the Ocfs2-commits
mailing list