]> git.neil.brown.name Git - LaFS.git/commitdiff
Add tracing to show orphans at shutdown.
authorNeilBrown <neilb@suse.de>
Fri, 25 Jun 2010 10:38:30 +0000 (20:38 +1000)
committerNeilBrown <neilb@suse.de>
Sun, 27 Jun 2010 23:15:00 +0000 (09:15 +1000)
We have had problems with orphans not disappearing.

Signed-off-by: NeilBrown <neilb@suse.de>
super.c

diff --git a/super.c b/super.c
index 8951caf826f5db7a5870c5a3e8bcd03fa4b44cc5..ccb06dafa4a9393aaef5f3c7c77c59e5d009fa36 100644 (file)
--- a/super.c
+++ b/super.c
@@ -677,6 +677,21 @@ lafs_release(struct fs *fs)
        kfree(fs);
 }
 
+static int show_orphans(struct fs *fs)
+{
+       struct datablock *db;
+       printk("Orphans:\n");
+       list_for_each_entry(db, &fs->pending_orphans,
+                           orphans) {
+               printk("orphan=%s\n", strblk(&db->b));
+               if (LAFSI(db->b.inode)->type == TypeInodeFile)
+                       lafs_print_tree(&LAFSI(db->my_inode)->iblock->b, 0);
+       }
+       printk("cleaner active: %d %d\n", fs->cleaner.active,
+              fs->scan.done);
+       return 1; /* meaningless, but makes it easy to add to wait_event below */
+}
+
 static void
 lafs_put_super(struct super_block *sb)
 {
@@ -697,6 +712,7 @@ lafs_put_super(struct super_block *sb)
 
                /* FIXME maybe I want these tests in a spinlock ?? */
                wait_event(fs->async_complete,
+                          show_orphans(fs) &&
                           !test_bit(OrphansRunning, &fs->fsstate) &&
                           list_empty(&fs->pending_orphans) &&
                           fs->scan.done == 1 &&