]> git.neil.brown.name Git - LaFS.git/commitdiff
Reinstitute a BUG_ON in checkpoint_unlock_wait and doco it.
authorNeilBrown <neilb@suse.de>
Fri, 9 Jul 2010 21:34:25 +0000 (07:34 +1000)
committerNeilBrown <neilb@suse.de>
Fri, 9 Jul 2010 21:34:25 +0000 (07:34 +1000)
When waiting for the checkpoint to pass, we need to have triggered
a checkpoint to start somehow.

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

index 485f47bec87dae00ed724baac2d8b18662503395..9cf7c460c059b9cf4a4c5cc996a2246aa845f152 100644 (file)
@@ -583,17 +583,15 @@ void lafs_checkpoint_unlock(struct fs *fs)
 
 void lafs_checkpoint_unlock_wait(struct fs *fs)
 {
-//     unsigned long long seq = fs->wc[0].cluster_seq;
-
-       // FIXME what is this about? BUG_ON(!fs->checkpoint_needed);
+       /* FIXME it is a bug if we haven't done something to
+        * make a checkpoint happen, else we could wait forever.
+        * As we still hold the lock prepare_checkpoint cannot
+        * have progressed, so CheckpointNeeded must be set.
+        */
+       BUG_ON(!test_bit(CheckpointNeeded, &fs->fsstate) &&
+              !test_bit(CleanerBlocks, &fs->fsstate));
        lafs_checkpoint_unlock(fs);
 
-       // lafs_cluster_wait(fs, seq);
-       /* FIXME I need to wait until it is worth trying to lock again,
-        * but what do I wait for??
-        * I used to wait for the next cluster to go, but that isn't
-        * right??
-        */
        wait_event(fs->phase_wait,
                   !test_bit(CleanerBlocks, &fs->fsstate) &&
                   !test_bit(CheckpointNeeded, &fs->fsstate) &&