From: NeilBrown Date: Mon, 9 Aug 2010 10:26:25 +0000 (+1000) Subject: checkpoint must wait for both dblock and iblock of root to change phase. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=9bb013ead76b0a88cac96cb23260f8f5e4a96608;p=LaFS.git checkpoint must wait for both dblock and iblock of root to change phase. Only waiting for iblock isn't enough - dblock might still be in the old phase, which gets rather confusing. Signed-off-by: NeilBrown --- diff --git a/checkpoint.c b/checkpoint.c index 36072bd..5c2dd61 100644 --- a/checkpoint.c +++ b/checkpoint.c @@ -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);