]> git.neil.brown.name Git - LaFS.git/commitdiff
Don't allow memory flush to write out segusage blocks.
authorNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 02:29:57 +0000 (12:29 +1000)
committerNeilBrown <neilb@suse.de>
Wed, 23 Jun 2010 02:49:46 +0000 (12:49 +1000)
We always write these after a checkpoint, and there is little to be
gained by writing them earlier, and doing so causes their
dirty status to be lost, which is bad.

They should be treated much like PinPending blocks, but they
are not PinPending as they are written later in the checkpoint.

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

index b2ebbf2d8149051151d6247fb4273b53c3e9465b..fc11b0d0793432228f587eb24a5216313b9fe2cf 100644 (file)
@@ -412,8 +412,10 @@ static void do_checkpoint(void *data)
 
 static void finish_checkpoint(struct fs *fs, int youth)
 {
+       set_bit(CheckpointFlushing, &fs->fsstate);
        lafs_seg_flush_all(fs);
        lafs_quota_flush(fs);
+       clear_bit(CheckpointFlushing, &fs->fsstate);
        if (!test_bit(FinalCheckpoint, &fs->fsstate))
                lafs_seg_apply_all(fs);
 
diff --git a/file.c b/file.c
index 69b6a8815126a348f7ec5aa2f73daf56650079b4..e902a8956783c525575e7e76b1ce4754711b315b 100644 (file)
--- a/file.c
+++ b/file.c
@@ -212,6 +212,10 @@ lafs_writepage(struct page *page, struct writeback_control *wbc)
                if (test_bit(B_Dirty, &b->b.flags)) {
                        if (test_bit(B_PinPending, &b->b.flags))
                                rv = AOP_WRITEPAGE_ACTIVATE;
+                       else if (LAFSI(ino)->type == TypeSegmentMap &&
+                                !test_bit(CheckpointFlushing, &fs->fsstate))
+                               /* FIXME or quota ?? */
+                               rv = AOP_WRITEPAGE_ACTIVATE;
                        else if (LAFSI(b->b.inode)->type == TypeInodeFile &&
                                 b->my_inode &&
                                 LAFSI(b->my_inode)->iblock)
diff --git a/state.h b/state.h
index f35e2e820bba55ebf6003a392f87f2fc5a7d4914..e065060013ac5c890394a0534f47ae17bc05dc5e 100644 (file)
--- a/state.h
+++ b/state.h
@@ -89,6 +89,7 @@ struct fs {
 #define FinalCheckpoint 3
 #define CleanerDisabled 4
 #define OrphansRunning 5
+#define CheckpointFlushing 6  /* We are writing the segusage blocks */
 
        struct work_struct done_work;   /* used for handling
                                         * refile after write completes */