[ofa-general] [PATCH] rds: fix call to sk_alloc

Jon Mason jon at opengridcomputing.com
Mon Aug 4 14:16:10 PDT 2008


The OFED-1.4 RDS calls to sk_alloc are broken, thus preventing rds from
establishing a connection.  sk_alloc function parameters changed between
kernel versions 2.6.23 and 2.6.24.  The current code erroneously checks
for 2.6.26 for this change.  The workaround code for no
KERNEL_HAS_PROTO_REGISTER lacks a function parameter (as it is #defined
over the standard sk_alloc call), and that functions call to sk_alloc
has parameters 3 and 4 swapped.

With the patch below, RDS will start working again.

Signed-Off-By: Jon Mason <jon at opengridcomputing.com>

diff --git a/net/rds/af_rds.c b/net/rds/af_rds.c
index e32f502..3b7ad33 100644
--- a/net/rds/af_rds.c
+++ b/net/rds/af_rds.c
@@ -399,11 +399,11 @@ static struct proto_ops rds_proto_ops = {
 };
 
 #ifndef KERNEL_HAS_PROTO_REGISTER
-static struct sock *sk_alloc_compat(int pf, gfp_t gfp, struct proto *prot)
+static struct sock *sk_alloc_compat(int pf, gfp_t gfp, struct proto *prot, int zero_it)
 {
 	struct rds_sock *rs;
 
-	sk = sk_alloc(pf, gfp, 1, NULL);
+	sk = sk_alloc(pf, gfp, prot, zero_it);
 	if (sk == NULL)
 		return NULL;
 
@@ -455,7 +455,7 @@ static int __rds_create(struct socket *sock, struct sock *sk, int protocol)
 	return 0;
 }
 
-#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 26)
+#if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 24)
 static int rds_create(struct socket *sock, int protocol)
 {
 	struct sock *sk;



More information about the general mailing list