[Ocfs2-commits] smushran commits r3033 - branches/ocfs2-1.2.5/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jul 3 14:46:11 PDT 2007


Author: smushran
Date: 2007-07-03 14:46:11 -0700 (Tue, 03 Jul 2007)
New Revision: 3033

Modified:
   branches/ocfs2-1.2.5/fs/ocfs2/cluster/tcp.c
Log:
ocfs2: Retry sendpage() if it returns EAGAIN
Instead of treating EAGAIN, returned from sendpage(), as an error, this patch
retries the operation.
Signed-off-by: mfasheh

Modified: branches/ocfs2-1.2.5/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/ocfs2-1.2.5/fs/ocfs2/cluster/tcp.c	2007-06-28 20:47:57 UTC (rev 3032)
+++ branches/ocfs2-1.2.5/fs/ocfs2/cluster/tcp.c	2007-07-03 21:46:11 UTC (rev 3033)
@@ -858,12 +858,19 @@
 	struct o2net_node *nn = o2net_nn_from_num(sc->sc_node->nd_num);
 	ssize_t ret;
 
-
-	ret = sc->sc_sock->ops->sendpage(sc->sc_sock,
-					 virt_to_page(kmalloced_virt),
-					 (long)kmalloced_virt & ~PAGE_MASK,
-					 size, MSG_DONTWAIT);
-	if (ret != size) {
+	while (1) {
+		ret = sc->sc_sock->ops->sendpage(sc->sc_sock,
+						 virt_to_page(kmalloced_virt),
+						 (long)kmalloced_virt & ~PAGE_MASK,
+						 size, MSG_DONTWAIT);
+		if (ret == size)
+			break;
+		if (ret == (ssize_t)-EAGAIN) {
+			mlog(0, "sendpage of size %zu to " SC_NODEF_FMT
+			     " returned EAGAIN\n", size, SC_NODEF_ARGS(sc));
+			cond_resched();
+			continue;
+		}
 		mlog(ML_ERROR, "sendpage of size %zu to " SC_NODEF_FMT 
 		     " failed with %zd\n", size, SC_NODEF_ARGS(sc), ret);
 		o2net_ensure_shutdown(nn, sc, 0);




More information about the Ocfs2-commits mailing list