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

CVS commit program cvs at parl.clemson.edu
Tue Feb 2 13:27:10 EST 2010


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

Modified Files:
      Tag: Orange-Branch
	client-state-machine.c 
Log Message:
Apply fix here as applied to head: 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/src/client/sysint/client-state-machine.c,v
diff -p -u -r1.101 -r1.101.10.1
--- client-state-machine.c	5 Feb 2009 15:53:37 -0000	1.101
+++ client-state-machine.c	2 Feb 2010 18:27:10 -0000	1.101.10.1
@@ -475,6 +475,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));
@@ -499,6 +500,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