]> git.neil.brown.name Git - LaFS.git/commitdiff
checkpoint must wait for both dblock and iblock of root to change phase.
authorNeilBrown <neilb@suse.de>
Mon, 9 Aug 2010 10:26:25 +0000 (20:26 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 9 Aug 2010 10:26:25 +0000 (20:26 +1000)
Only waiting for iblock isn't enough - dblock might still be in the
old phase, which gets rather confusing.

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

index 36072bd2ad1fb79ff405f94e2cf897c6b17464df..5c2dd615de3690e7a991bfb1672eb9aa236f7cb7 100644 (file)
@@ -438,9 +438,13 @@ again:
 
                putref(b, MKREF(leaf));
        }
-       if (test_bit(B_Pinned, &LAFSI(fs->ss[0].root)->iblock->b.flags) &&
-           !!test_bit(B_Phase1, &LAFSI(fs->ss[0].root)->iblock->b.flags)
-           != fs->phase) {
+       if ((test_bit(B_Pinned, &LAFSI(fs->ss[0].root)->iblock->b.flags) &&
+            !!test_bit(B_Phase1, &LAFSI(fs->ss[0].root)->iblock->b.flags)
+            != fs->phase)
+           ||
+           (test_bit(B_Pinned, &LAFSI(fs->ss[0].root)->dblock->b.flags) &&
+            !!test_bit(B_Phase1, &LAFSI(fs->ss[0].root)->dblock->b.flags)
+            != fs->phase)) {
                if (loops == 20) {
                        printk("Cannot escape PHASE=%d\n", oldphase);
                        lafs_print_tree(&LAFSI(fs->ss[0].root)->dblock->b, 0);