Index: src/client/sysint/sys-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-io.sm,v
retrieving revision 1.144
diff -u -r1.144 sys-io.sm
--- src/client/sysint/sys-io.sm	28 May 2006 16:33:19 -0000	1.144
+++ src/client/sysint/sys-io.sm	14 Jun 2006 18:04:19 -0000
@@ -812,37 +812,6 @@
             cur_ctx->msg_send_has_been_posted = 1;
             ++sm_p->u.io.msgpair_completion_count;
         }
-
-        if(sm_p->u.io.io_type == PVFS_IO_WRITE)
-        {
-            ret = io_post_flow(sm_p, cur_ctx);
-            if(ret < 0)
-            {
-                char buf[64] = {0};
-                PVFS_strerror_r(ret, buf, 64);
-
-                gossip_debug(GOSSIP_IO_DEBUG,
-                             "%s: io_post_flow failed: "
-                             "%s (%d remaining msgpairs)\n",
-                             __func__, 
-                             buf, 
-                             sm_p->u.io.msgpair_completion_count);
-
-                PVFS_perror_gossip("Flow post failed", ret);
-                cur_ctx->msg_send_has_been_posted = 0;
-                cur_ctx->msg_recv_has_been_posted = 0;
-                js_p->error_code = ret;
-                continue;
-            }
-
-            ret = io_post_write_ack_recv(sm_p, cur_ctx);
-            if(ret < 0)
-            {
-                PVFS_perror_gossip("Post of write-ack recv failed", ret);
-                js_p->error_code = ret;
-                continue;
-            }
-        }
     }
 
     gossip_debug(GOSSIP_IO_DEBUG, "io_datafile_post_msgpairs: "
@@ -969,24 +938,35 @@
             goto check_next_step;
         }
  
-        if(sm_p->u.io.io_type == PVFS_IO_READ)
+        /* for now we wait to post the flow until we get back
+         * the response from the server for both reads and writes
+         */
+        ret = io_post_flow(sm_p, cur_ctx);
+        if(ret < 0)
         {
-            ret = io_post_flow(sm_p, cur_ctx);
+            char buf[64] = {0};
+            PVFS_strerror_r(ret, buf, 64);
+
+            gossip_debug(GOSSIP_IO_DEBUG,
+                         "%s: io_post_flow failed: "
+                         "%s (%d remaining msgpairs)\n",
+                         __func__, 
+                         buf, 
+                         sm_p->u.io.msgpair_completion_count);
+
+            PVFS_perror_gossip("Flow post failed", ret);
+            cur_ctx->msg_send_has_been_posted = 0;
+            cur_ctx->msg_recv_has_been_posted = 0;
+            js_p->error_code = ret;
+            goto check_next_step;
+        }
+
+        if(sm_p->u.io.io_type == PVFS_IO_WRITE)
+        {
+            ret = io_post_write_ack_recv(sm_p, cur_ctx);
             if(ret < 0)
             {
-                char buf[64] = {0};
-                PVFS_strerror_r(ret, buf, 64);
-
-                gossip_debug(GOSSIP_IO_DEBUG,
-                             "%s: io_post_flow failed: "
-                             "%s (%d remaining msgpairs)\n",
-                             __func__, 
-                             buf, 
-                             sm_p->u.io.msgpair_completion_count);
-
-                PVFS_perror_gossip("Flow post failed", ret);
-                cur_ctx->msg_send_has_been_posted = 0;
-                cur_ctx->msg_recv_has_been_posted = 0;
+                PVFS_perror_gossip("Post of write-ack recv failed", ret);
                 js_p->error_code = ret;
                 goto check_next_step;
             }
