? src/client/sysint/.client-state-machine.h.swp
? src/client/sysint/.sys-io.sm.swp
Index: src/client/sysint/client-state-machine.h
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/client-state-machine.h,v
retrieving revision 1.161
diff -u -r1.161 client-state-machine.h
--- src/client/sysint/client-state-machine.h	29 May 2006 16:21:10 -0000	1.161
+++ src/client/sysint/client-state-machine.h	15 Jun 2006 16:49:24 -0000
@@ -50,6 +50,7 @@
 /* Default number of milliseconds to delay before retries */
 #define PVFS2_CLIENT_RETRY_DELAY_MS_DEFAULT  2000
 
+#define SMALL_IO_MAX_REGIONS 64
 
 /* PINT_client_sm_recv_state_s
  *
Index: src/client/sysint/sys-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-io.sm,v
retrieving revision 1.145
diff -u -r1.145 sys-io.sm
--- src/client/sysint/sys-io.sm	15 Jun 2006 14:58:46 -0000	1.145
+++ src/client/sysint/sys-io.sm	15 Jun 2006 16:49:24 -0000
@@ -2159,7 +2159,7 @@
     PINT_Request_result tmp_result;
     PVFS_offset offsets;
     PVFS_size sizes;
-    int total_bytes = 0;
+    int total_bytes = 0, total_segs = 0;
 
     gossip_debug(GOSSIP_IO_DEBUG, "- io_find_target_datafiles called\n");
 
@@ -2238,6 +2238,7 @@
         tmp_result.offset_array = &offsets;
         tmp_result.size_array = &sizes;
         total_bytes = 0;
+        total_segs = 0;
 
         /* we need to keep processing the request (not just check for non-zero)
          * so that we can figure out whether to do small I/O.
@@ -2259,6 +2260,7 @@
             }
 
             total_bytes += tmp_result.bytes;
+            total_segs += tmp_result.segs;
 
             /* we limit the request processing for each datafile to only
              * check that the size is as least as big as max_unexp_size.
@@ -2275,7 +2277,8 @@
             handle_index_array[(*handle_index_out_count)++] = i;
 
 #ifndef PVFS2_SMALL_IO_OFF
-            if(total_bytes <= max_unexp_payload)
+            if(total_bytes <= max_unexp_payload &&
+               total_segs <= SMALL_IO_MAX_REGIONS)
             {
                 sio_handle_index_array[(*sio_handle_index_count)++] = i;
             }
Index: src/client/sysint/sys-small-io.sm
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/client/sysint/sys-small-io.sm,v
retrieving revision 1.8
diff -u -r1.8 sys-small-io.sm
--- src/client/sysint/sys-small-io.sm	27 May 2006 18:57:36 -0000	1.8
+++ src/client/sysint/sys-small-io.sm	15 Jun 2006 16:49:24 -0000
@@ -25,8 +25,6 @@
 #include "pint-util.h"
 #include "pvfs2-internal.h"
 
-#define SMALL_IO_MAX_REGIONS 64
-
 /* The small-io state machine should only be invoked/jumped-to from the
  * sys-io state machine.  We make this assumption and expect io parameters
  * to be initialized already.
