[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/client/sysint: client-state-machine.c

CVS commit program cvs at parl.clemson.edu
Fri Jan 15 15:17:11 EST 2010


Update of /projects/cvsroot/pvfs2-1/src/client/sysint
In directory parlweb1:/tmp/cvs-serv6950/src/client/sysint

Modified Files:
	client-state-machine.c 
Log Message:
Bug fix for pvfs2-client-core seg fault on write cancellation reported by
Michael Moore.  The cancellation logic is only intended to handle standard
I/O operations but was being triggered by small-io operations as well,
leading to memory corruption.


Index: client-state-machine.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/client/sysint/client-state-machine.c,v
diff -p -u -r1.103 -r1.104
--- client-state-machine.c	7 Oct 2009 13:48:49 -0000	1.103
+++ client-state-machine.c	15 Jan 2010 20:17:11 -0000	1.104
@@ -483,6 +483,7 @@ PVFS_error PINT_client_io_cancel(PVFS_sy
     PVFS_error ret = -PVFS_EINVAL;
     PINT_smcb *smcb = NULL;
     PINT_client_sm *sm_p = NULL;
+    PINT_client_sm *sm_base_p = NULL;
 
     gossip_debug(GOSSIP_CLIENT_DEBUG,
             "PINT_client_io_cancel id %lld\n",lld(id));
@@ -507,6 +508,18 @@ PVFS_error PINT_client_io_cancel(PVFS_sy
     {
 	/* op already completed; nothing to cancel. */
         return 0;
+    }
+    
+    /* We also don't cancel small I/O operations as posted by
+     * sys-small-io.sm.  Check the corresponding flag.  We have 
+     * to jump to the base frame rather than the current frame for this
+     * information because small-io may have pushed a msgpairarray.
+     */ 
+    sm_base_p = PINT_sm_frame(smcb, (-(smcb->frame_count -1)));
+    if(sm_base_p->u.io.small_io)
+    {
+        gossip_debug(GOSSIP_CANCEL_DEBUG,  "skipping cancellation of small I/O operation.\n");
+        return(0);
     }
 
     /* if we fall to here, the I/O operation is still in flight */



More information about the Pvfs2-cvs mailing list