In-progress work on better cache flushing.
[bluesky.git] / bluesky / inode.c
index ef6e75d..39feff8 100644 (file)
@@ -133,10 +133,14 @@ void bluesky_inode_unref(BlueSkyInode *inode)
 
         /* Sanity check: Is the inode clean? */
         if (inode->change_commit < inode->change_count
+                || inode->accessed_list != NULL
                 || inode->dirty_list != NULL) {
-            g_warning("Dropping inode which is not clean (commit %"PRIi64" < change %"PRIi64"; dirty_list = %p)\n", inode->change_commit, inode->change_count, inode->dirty_list);
+            g_warning("Dropping inode which is not clean (commit %"PRIi64" < change %"PRIi64"; accessed_list = %p; dirty_list = %p)\n", inode->change_commit, inode->change_count, inode->accessed_list, inode->dirty_list);
         }
 
+        /* These shouldn't be needed, but in case the above warning fires and
+         * we delete the inode anyway, we ought to be sure the inode is not on
+         * any LRU list. */
         g_mutex_lock(inode->fs->lock);
         bluesky_list_unlink(&inode->fs->accessed_list, inode->accessed_list);
         bluesky_list_unlink(&inode->fs->dirty_list, inode->dirty_list);