[Ocfs2-commits] smushran commits r3040 - branches/ocfs2-1.2.6/fs/ocfs2/cluster

svn-commits at oss.oracle.com svn-commits at oss.oracle.com
Tue Jul 24 13:22:05 PDT 2007


Author: smushran
Date: 2007-07-24 13:22:04 -0700 (Tue, 24 Jul 2007)
New Revision: 3040

Modified:
   branches/ocfs2-1.2.6/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.6/fs/ocfs2/cluster/tcp.c
===================================================================
--- branches/ocfs2-1.2.6/fs/ocfs2/cluster/tcp.c	2007-07-24 20:20:26 UTC (rev 3039)
+++ branches/ocfs2-1.2.6/fs/ocfs2/cluster/tcp.c	2007-07-24 20:22:04 UTC (rev 3040)
@@ -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