>From 83a397e19f378d7ba1c2d7587ff16ed39b8d4f58 Mon Sep 17 00:00:00 2001
From: Jeff Becker <Jeffrey.C.Becker@nasa.gov>
Date: Tue, 11 Oct 2011 11:59:11 -0700
Subject: [PATCH 3/4] NFSRDMA: pull in more patches for RHEL6.1 - builds successfully
 Signed-off-by: Jeff Becker <Jeffrey.C.Becker@nasa.gov>

---
 ...ve-duplicate-universal-address-generation.patch |   42 +++++++++++
 ...rpc_ntop-for-constructing-transport-addre.patch |   74 ++++++++++++++++++++
 .../nfsrdma-0003-SUNRPC-Kill-RPC_DISPLAY_ALL.patch |   28 ++++++++
 ...-the-test-for-XPRT_CONNECTING-into-xprt_c.patch |   49 +++++++++++++
 ...-Fail-over-more-quickly-on-connect-errors.patch |   25 +++++++
 ...-the-task-tk_bytes_sent-and-tk_rtt-to-str.patch |   24 ++++++
 ...007-sunrpc-Factor-out-rpc_xprt-allocation.patch |   38 ++++++++++
 ...a-0008-sunrpc-Factor-out-rpc_xprt-freeing.patch |   33 +++++++++
 ...nfsrdma-0009-sunrpc-Tag-rpc_xprt-with-net.patch |   25 +++++++
 9 files changed, 338 insertions(+), 0 deletions(-)
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0001-SUNRPC-Remove-duplicate-universal-address-generation.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0002-SUNRPC-Use-rpc_ntop-for-constructing-transport-addre.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0003-SUNRPC-Kill-RPC_DISPLAY_ALL.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0004-SUNRPC-Move-the-test-for-XPRT_CONNECTING-into-xprt_c.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0005-SUNRPC-Fail-over-more-quickly-on-connect-errors.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0006-SUNRPC-Move-the-task-tk_bytes_sent-and-tk_rtt-to-str.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0007-sunrpc-Factor-out-rpc_xprt-allocation.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0008-sunrpc-Factor-out-rpc_xprt-freeing.patch
 create mode 100644 kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0009-sunrpc-Tag-rpc_xprt-with-net.patch

diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0001-SUNRPC-Remove-duplicate-universal-address-generation.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0001-SUNRPC-Remove-duplicate-universal-address-generation.patch
new file mode 100644
index 0000000..de9c3a8
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0001-SUNRPC-Remove-duplicate-universal-address-generation.patch
@@ -0,0 +1,42 @@
+From ba809130bc260fce04141aca01ef9e068d32af2a Mon Sep 17 00:00:00 2001
+From: Chuck Lever <chuck.lever@oracle.com>
+Date: Sun, 9 Aug 2009 15:09:35 -0400
+Subject: [PATCH] SUNRPC: Remove duplicate universal address generation
+
+RPC universal address generation is currently done in several places:
+rpcb_clnt.c, nfs4proc.c xprtsock.c, and xprtrdma.c.  Remove the
+redundant cases that convert a socket address to a universal
+address.  The nfs4proc.c case takes a pre-formatted presentation
+address string, not a socket address, so we'll leave that one.
+
+Because the new uaddr constructor uses the recently introduced
+rpc_ntop(), it now supports proper "::" shorthanding for IPv6
+addresses.  This allows the kernel to register properly formed
+universal addresses with the local rpcbind service, in _all_ cases.
+
+The kernel can now also send properly formed universal addresses in
+RPCB_GETADDR requests, and support link-local properly when
+encoding and decoding IPv6 addresses.
+
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 1dd6123..537c210 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -202,14 +202,6 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
+ 		snprintf(buf, 8, "%4hx", ntohs(addr->sin_port));
+ 	xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf;
+ 
+-	buf = kzalloc(30, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 30, "%pI4.%u.%u",
+-			&addr->sin_addr.s_addr,
+-			ntohs(addr->sin_port) >> 8,
+-			ntohs(addr->sin_port) & 0xff);
+-	xprt->address_strings[RPC_DISPLAY_UNIVERSAL_ADDR] = buf;
+-
+ 	/* netid */
+ 	xprt->address_strings[RPC_DISPLAY_NETID] = "rdma";
+ }
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0002-SUNRPC-Use-rpc_ntop-for-constructing-transport-addre.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0002-SUNRPC-Use-rpc_ntop-for-constructing-transport-addre.patch
new file mode 100644
index 0000000..67d3f7b
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0002-SUNRPC-Use-rpc_ntop-for-constructing-transport-addre.patch
@@ -0,0 +1,74 @@
+From c877b849d302d1275452af80b7221a2555dc02e1 Mon Sep 17 00:00:00 2001
+From: Chuck Lever <chuck.lever@oracle.com>
+Date: Sun, 9 Aug 2009 15:09:36 -0400
+Subject: [PATCH] SUNRPC: Use rpc_ntop() for constructing transport address strings
+
+Clean up:  In addition to using the new generic rpc_ntop() and
+rpc_get_port() functions, have the RPC client compute the presentation
+address buffer sizes dynamically using kstrdup().
+
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 537c210..5f9b867 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -168,39 +168,30 @@ static struct rpc_xprt_ops xprt_rdma_procs;	/* forward reference */
+ static void
+ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
+ {
+-	struct sockaddr_in *addr = (struct sockaddr_in *)
++	struct sockaddr *sap = (struct sockaddr *)
+ 					&rpcx_to_rdmad(xprt).addr;
+-	char *buf;
++	struct sockaddr_in *sin = (struct sockaddr_in *)sap;
++	char buf[64];
+ 
+-	buf = kzalloc(20, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 20, "%pI4", &addr->sin_addr.s_addr);
+-	xprt->address_strings[RPC_DISPLAY_ADDR] = buf;
++	(void)rpc_ntop(sap, buf, sizeof(buf));
++	xprt->address_strings[RPC_DISPLAY_ADDR] = kstrdup(buf, GFP_KERNEL);
+ 
+-	buf = kzalloc(8, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 8, "%u", ntohs(addr->sin_port));
+-	xprt->address_strings[RPC_DISPLAY_PORT] = buf;
++	(void)snprintf(buf, sizeof(buf), "%u", rpc_get_port(sap));
++	xprt->address_strings[RPC_DISPLAY_PORT] = kstrdup(buf, GFP_KERNEL);
+ 
+ 	xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma";
+ 
+-	buf = kzalloc(48, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 48, "addr=%pI4 port=%u proto=%s",
+-			&addr->sin_addr.s_addr,
+-			ntohs(addr->sin_port), "rdma");
+-	xprt->address_strings[RPC_DISPLAY_ALL] = buf;
+-
+-	buf = kzalloc(10, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 10, "%02x%02x%02x%02x",
+-			NIPQUAD(addr->sin_addr.s_addr));
+-	xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = buf;
+-
+-	buf = kzalloc(8, GFP_KERNEL);
+-	if (buf)
+-		snprintf(buf, 8, "%4hx", ntohs(addr->sin_port));
+-	xprt->address_strings[RPC_DISPLAY_HEX_PORT] = buf;
++	(void)snprintf(buf, sizeof(buf), "addr=%s port=%s proto=rdma",
++			xprt->address_strings[RPC_DISPLAY_ADDR],
++			xprt->address_strings[RPC_DISPLAY_PORT]);
++	xprt->address_strings[RPC_DISPLAY_ALL] = kstrdup(buf, GFP_KERNEL);
++
++	(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
++				NIPQUAD(sin->sin_addr.s_addr));
++	xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL);
++
++	(void)snprintf(buf, sizeof(buf), "%4hx", rpc_get_port(sap));
++	xprt->address_strings[RPC_DISPLAY_HEX_PORT] = kstrdup(buf, GFP_KERNEL);
+ 
+ 	/* netid */
+ 	xprt->address_strings[RPC_DISPLAY_NETID] = "rdma";
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0003-SUNRPC-Kill-RPC_DISPLAY_ALL.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0003-SUNRPC-Kill-RPC_DISPLAY_ALL.patch
new file mode 100644
index 0000000..7711a04
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0003-SUNRPC-Kill-RPC_DISPLAY_ALL.patch
@@ -0,0 +1,28 @@
+From c740eff84bcfd63c0497ef880e80171931cb8222 Mon Sep 17 00:00:00 2001
+From: Chuck Lever <chuck.lever@oracle.com>
+Date: Sun, 9 Aug 2009 15:09:46 -0400
+Subject: [PATCH] SUNRPC: Kill RPC_DISPLAY_ALL
+
+At some point, I recall that rpc_pipe_fs used RPC_DISPLAY_ALL.
+Currently there are no uses of RPC_DISPLAY_ALL outside the transport
+modules themselves, so we can safely get rid of it.
+
+Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 5f9b867..9a63f66 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -181,11 +181,6 @@ xprt_rdma_format_addresses(struct rpc_xprt *xprt)
+ 
+ 	xprt->address_strings[RPC_DISPLAY_PROTO] = "rdma";
+ 
+-	(void)snprintf(buf, sizeof(buf), "addr=%s port=%s proto=rdma",
+-			xprt->address_strings[RPC_DISPLAY_ADDR],
+-			xprt->address_strings[RPC_DISPLAY_PORT]);
+-	xprt->address_strings[RPC_DISPLAY_ALL] = kstrdup(buf, GFP_KERNEL);
+-
+ 	(void)snprintf(buf, sizeof(buf), "%02x%02x%02x%02x",
+ 				NIPQUAD(sin->sin_addr.s_addr));
+ 	xprt->address_strings[RPC_DISPLAY_HEX_ADDR] = kstrdup(buf, GFP_KERNEL);
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0004-SUNRPC-Move-the-test-for-XPRT_CONNECTING-into-xprt_c.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0004-SUNRPC-Move-the-test-for-XPRT_CONNECTING-into-xprt_c.patch
new file mode 100644
index 0000000..5a1d1ea
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0004-SUNRPC-Move-the-test-for-XPRT_CONNECTING-into-xprt_c.patch
@@ -0,0 +1,49 @@
+From 0b9e79431377df452348e78262dd5a3dc359eeef Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Fri, 16 Apr 2010 16:41:57 -0400
+Subject: [PATCH] SUNRPC: Move the test for XPRT_CONNECTING into xprt_connect()
+
+This fixes a bug with setting xprt->stat.connect_start.
+
+Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 187257b..0607b9a 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -449,21 +449,19 @@ xprt_rdma_connect(struct rpc_task *task)
+ 	struct rpc_xprt *xprt = (struct rpc_xprt *)task->tk_xprt;
+ 	struct rpcrdma_xprt *r_xprt = rpcx_to_rdmax(xprt);
+ 
+-	if (!xprt_test_and_set_connecting(xprt)) {
+-		if (r_xprt->rx_ep.rep_connected != 0) {
+-			/* Reconnect */
+-			schedule_delayed_work(&r_xprt->rdma_connect,
+-				xprt->reestablish_timeout);
+-			xprt->reestablish_timeout <<= 1;
+-			if (xprt->reestablish_timeout > (30 * HZ))
+-				xprt->reestablish_timeout = (30 * HZ);
+-			else if (xprt->reestablish_timeout < (5 * HZ))
+-				xprt->reestablish_timeout = (5 * HZ);
+-		} else {
+-			schedule_delayed_work(&r_xprt->rdma_connect, 0);
+-			if (!RPC_IS_ASYNC(task))
+-				flush_scheduled_work();
+-		}
++	if (r_xprt->rx_ep.rep_connected != 0) {
++		/* Reconnect */
++		schedule_delayed_work(&r_xprt->rdma_connect,
++			xprt->reestablish_timeout);
++		xprt->reestablish_timeout <<= 1;
++		if (xprt->reestablish_timeout > (30 * HZ))
++			xprt->reestablish_timeout = (30 * HZ);
++		else if (xprt->reestablish_timeout < (5 * HZ))
++			xprt->reestablish_timeout = (5 * HZ);
++	} else {
++		schedule_delayed_work(&r_xprt->rdma_connect, 0);
++		if (!RPC_IS_ASYNC(task))
++			flush_scheduled_work();
+ 	}
+ }
+ 
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0005-SUNRPC-Fail-over-more-quickly-on-connect-errors.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0005-SUNRPC-Fail-over-more-quickly-on-connect-errors.patch
new file mode 100644
index 0000000..4b0b2fc
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0005-SUNRPC-Fail-over-more-quickly-on-connect-errors.patch
@@ -0,0 +1,25 @@
+From a8ce4a8f37fef0a09a1e920c2e09f67a80426c7e Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Fri, 16 Apr 2010 16:42:12 -0400
+Subject: [PATCH] SUNRPC: Fail over more quickly on connect errors
+
+We should not allow soft tasks to wait for longer than the major timeout
+period when waiting for a reconnect to occur.
+
+Remove the field xprt->connect_timeout since it has been obsoleted by
+xprt->reestablish_timeout.
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 0607b9a..3f3b38c 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -305,7 +305,6 @@ xprt_setup_rdma(struct xprt_create *args)
+ 	/* 60 second timeout, no retries */
+ 	xprt->timeout = &xprt_rdma_default_timeout;
+ 	xprt->bind_timeout = (60U * HZ);
+-	xprt->connect_timeout = (60U * HZ);
+ 	xprt->reestablish_timeout = (5U * HZ);
+ 	xprt->idle_timeout = (5U * 60 * HZ);
+ 
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0006-SUNRPC-Move-the-task-tk_bytes_sent-and-tk_rtt-to-str.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0006-SUNRPC-Move-the-task-tk_bytes_sent-and-tk_rtt-to-str.patch
new file mode 100644
index 0000000..148aba1
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0006-SUNRPC-Move-the-task-tk_bytes_sent-and-tk_rtt-to-str.patch
@@ -0,0 +1,24 @@
+From d60dbb20a74c2cfa142be0a34dac3c6547ea086c Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <Trond.Myklebust@netapp.com>
+Date: Thu, 13 May 2010 12:51:49 -0400
+Subject: [PATCH] SUNRPC: Move the task->tk_bytes_sent and tk_rtt to struct rpc_rqst
+
+It seems strange to maintain stats for bytes_sent in one structure, and
+bytes received in another. Try to assemble all the RPC request-related
+stats in struct rpc_rqst
+
+Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 3f3b38c..a85e866 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -674,7 +674,7 @@ xprt_rdma_send_request(struct rpc_task *task)
+ 	if (rpcrdma_ep_post(&r_xprt->rx_ia, &r_xprt->rx_ep, req))
+ 		goto drop_connection;
+ 
+-	task->tk_bytes_sent += rqst->rq_snd_buf.len;
++	rqst->rq_xmit_bytes_sent += rqst->rq_snd_buf.len;
+ 	rqst->rq_bytes_sent = 0;
+ 	return 0;
+ 
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0007-sunrpc-Factor-out-rpc_xprt-allocation.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0007-sunrpc-Factor-out-rpc_xprt-allocation.patch
new file mode 100644
index 0000000..b21a33c
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0007-sunrpc-Factor-out-rpc_xprt-allocation.patch
@@ -0,0 +1,38 @@
+From bd1722d4316e42a12fe6337ebe34d7e1e2c088b2 Mon Sep 17 00:00:00 2001
+From: Pavel Emelyanov <xemul@parallels.com>
+Date: Wed, 29 Sep 2010 16:02:43 +0400
+Subject: [PATCH] sunrpc: Factor out rpc_xprt allocation
+
+Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index a85e866..9d77bf2 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -285,23 +285,14 @@ xprt_setup_rdma(struct xprt_create *args)
+ 		return ERR_PTR(-EBADF);
+ 	}
+ 
+-	xprt = kzalloc(sizeof(struct rpcrdma_xprt), GFP_KERNEL);
++	xprt = xprt_alloc(sizeof(struct rpcrdma_xprt),
++			xprt_rdma_slot_table_entries);
+ 	if (xprt == NULL) {
+ 		dprintk("RPC:       %s: couldn't allocate rpcrdma_xprt\n",
+ 			__func__);
+ 		return ERR_PTR(-ENOMEM);
+ 	}
+ 
+-	xprt->max_reqs = xprt_rdma_slot_table_entries;
+-	xprt->slot = kcalloc(xprt->max_reqs,
+-				sizeof(struct rpc_rqst), GFP_KERNEL);
+-	if (xprt->slot == NULL) {
+-		dprintk("RPC:       %s: couldn't allocate %d slots\n",
+-			__func__, xprt->max_reqs);
+-		kfree(xprt);
+-		return ERR_PTR(-ENOMEM);
+-	}
+-
+ 	/* 60 second timeout, no retries */
+ 	xprt->timeout = &xprt_rdma_default_timeout;
+ 	xprt->bind_timeout = (60U * HZ);
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0008-sunrpc-Factor-out-rpc_xprt-freeing.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0008-sunrpc-Factor-out-rpc_xprt-freeing.patch
new file mode 100644
index 0000000..af4eb54
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0008-sunrpc-Factor-out-rpc_xprt-freeing.patch
@@ -0,0 +1,33 @@
+From e204e621b4160c802315bc2d0fa335337c0d62e8 Mon Sep 17 00:00:00 2001
+From: Pavel Emelyanov <xemul@parallels.com>
+Date: Wed, 29 Sep 2010 16:03:13 +0400
+Subject: [PATCH] sunrpc: Factor out rpc_xprt freeing
+
+Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 9d77bf2..0f7a1b9 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -251,9 +251,7 @@ xprt_rdma_destroy(struct rpc_xprt *xprt)
+ 
+ 	xprt_rdma_free_addresses(xprt);
+ 
+-	kfree(xprt->slot);
+-	xprt->slot = NULL;
+-	kfree(xprt);
++	xprt_free(xprt);
+ 
+ 	dprintk("RPC:       %s: returning\n", __func__);
+ 
+@@ -401,8 +399,7 @@ out3:
+ out2:
+ 	rpcrdma_ia_close(&new_xprt->rx_ia);
+ out1:
+-	kfree(xprt->slot);
+-	kfree(xprt);
++	xprt_free(xprt);
+ 	return ERR_PTR(rc);
+ }
+ 
diff --git a/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0009-sunrpc-Tag-rpc_xprt-with-net.patch b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0009-sunrpc-Tag-rpc_xprt-with-net.patch
new file mode 100644
index 0000000..6b43edc
--- /dev/null
+++ b/kernel_patches/backport/2.6.32-EL6.1/nfsrdma-0009-sunrpc-Tag-rpc_xprt-with-net.patch
@@ -0,0 +1,25 @@
+From 37aa2133731d9231eb834f700119f0d3f1ed2664 Mon Sep 17 00:00:00 2001
+From: Pavel Emelyanov <xemul@parallels.com>
+Date: Wed, 29 Sep 2010 16:05:43 +0400
+Subject: [PATCH] sunrpc: Tag rpc_xprt with net
+
+The net is known from the xprt_create and this tagging will also
+give un the context in the conntection workers where real sockets
+are created.
+
+Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
+Signed-off-by: J. Bruce Fields <bfields@redhat.com>
+---
+diff --git a/net/sunrpc/xprtrdma/transport.c b/net/sunrpc/xprtrdma/transport.c
+index 0f7a1b9..2da32b4 100644
+--- a/net/sunrpc/xprtrdma/transport.c
++++ b/net/sunrpc/xprtrdma/transport.c
+@@ -283,7 +283,7 @@ xprt_setup_rdma(struct xprt_create *args)
+ 		return ERR_PTR(-EBADF);
+ 	}
+ 
+-	xprt = xprt_alloc(sizeof(struct rpcrdma_xprt),
++	xprt = xprt_alloc(args->net, sizeof(struct rpcrdma_xprt),
+ 			xprt_rdma_slot_table_entries);
+ 	if (xprt == NULL) {
+ 		dprintk("RPC:       %s: couldn't allocate rpcrdma_xprt\n",
-- 
1.7.3.4

