Fix a bug in committing of dirty inodes to stable storage.
authorMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 22 Mar 2010 23:38:53 +0000 (16:38 -0700)
committerMichael Vrable <mvrable@cs.ucsd.edu>
Mon, 22 Mar 2010 23:38:53 +0000 (16:38 -0700)
Previously, if an inode changed while it was being committed, we would
stall all future commits.  Now allow those commits to proceed once the
first commit is done.

bluesky/cache.c

index 8d2cda1..1f10db0 100644 (file)
@@ -28,10 +28,10 @@ static void writeback_complete(gpointer a, gpointer i)
     g_mutex_lock(inode->lock);
 
     inode->change_commit = inode->change_pending;
+    inode->change_pending = 0;
     if (inode->change_count == inode->change_commit) {
         /* If inode is no longer dirty... */
         inode->change_time = 0;
-        inode->change_pending = 0;
     }
 
     g_mutex_unlock(inode->lock);