[Pvfs2-cvs] commit by pcarns in pvfs2-1/src/io/job: job.c

CVS commit program cvs at parl.clemson.edu
Thu May 6 15:42:34 EDT 2010


Update of /projects/cvsroot/pvfs2-1/src/io/job
In directory parlweb1:/tmp/cvs-serv27895/src/io/job

Modified Files:
	job.c 
Log Message:
Fix race condition in operation counting for precreate pool usage in
unstuff operation.  This fixes the bug reported by Bart Taylor in which a
system upgraded from 2.6.3 to 2.8.2 fails to write large files until the
daemons are restarted.


Index: job.c
===================================================================
RCS file: /projects/cvsroot/pvfs2-1/src/io/job/job.c,v
diff -p -u -r1.190 -r1.191
--- job.c	6 Nov 2009 18:04:54 -0000	1.190
+++ job.c	6 May 2010 19:42:34 -0000	1.191
@@ -4426,7 +4426,10 @@ static void precreate_pool_get_thread_mg
     }
 
     trove_pending_count--;
+    assert(trove_pending_count >= 0);
+
     tmp_trove->jd->u.precreate_pool.trove_pending--;
+    assert(tmp_trove->jd->u.precreate_pool.trove_pending >= 0);
 
     /* don't overwrite error codes from other trove ops */
     if(tmp_trove->jd->u.precreate_pool.error_code == 0)
@@ -5897,6 +5900,10 @@ static void precreate_pool_get_handles_t
             }
         }
 
+        /* pre-increment pending count before posting trove operation */
+        trove_pending_count++;
+        jd->u.precreate_pool.trove_pending++;
+
         /* post trove operation to pull out a handle */
         ret = trove_keyval_iterate_keys(
             fs->fsid, 
@@ -5926,8 +5933,6 @@ static void precreate_pool_get_handles_t
         else
         {
             /* callback will be triggered later */
-            trove_pending_count++;
-            jd->u.precreate_pool.trove_pending++;
         }
     }
     gen_mutex_unlock(&precreate_pool_mutex);



More information about the Pvfs2-cvs mailing list