]> git.neil.brown.name Git - LaFS.git/commitdiff
Clean up final check of leafs lists.
authorNeilBrown <neilb@suse.de>
Fri, 25 Jun 2010 05:57:52 +0000 (15:57 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 25 Jun 2010 05:57:52 +0000 (15:57 +1000)
Clearing the Pinned bit just confused the following
printout, so skip that.
And check that clean_leafs is empty too.

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

diff --git a/super.c b/super.c
index e2e8a03d9f88cb689e481b521e9189ad9d774a85..96f3df0bef20936ce64c7d367243e20462d6db02 100644 (file)
--- a/super.c
+++ b/super.c
@@ -641,6 +641,9 @@ lafs_release(struct fs *fs)
                dv->sb = NULL;
        }
 
+       /* Final checkpoint will have cleared out the leafs lists,
+        * so they should all be empty.
+        */
        /* Lets see what is on the 'leaf' list? */
        for (i = 0; i < 2; i++) {
                struct block *b;
@@ -650,17 +653,18 @@ lafs_release(struct fs *fs)
                        /* FIXME this only OK for readonly mounts.
                        */
                        getref(b, MKREF(release));
-                       if (test_and_clear_bit(B_Pinned, &b->flags)) {
+                       lafs_refile(b, 0);
+                       if (test_bit(B_Pinned, &b->flags)) {
                                /* didn't fix the pincnt !! */
                                printk("This was pinned: %s\n", strblk(b));
                                lafs_print_tree(b, 1);
                                BUG();
                        }
-                       /* FIXME must clean it out better e.g. return Credits */
                        putref(b, MKREF(release));
                        goto retry;
                }
        }
+       BUG_ON(!list_empty(&fs->clean_leafs));
 
        flush_scheduled_work();
        lafs_stop_cleaner(fs);