From: NeilBrown Date: Wed, 23 Jun 2010 02:29:57 +0000 (+1000) Subject: Don't allow memory flush to write out segusage blocks. X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=43d8fea7e00d1260352a3f707e0f948e4a53f249;p=LaFS.git Don't allow memory flush to write out segusage blocks. 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 --- diff --git a/checkpoint.c b/checkpoint.c index b2ebbf2..fc11b0d 100644 --- a/checkpoint.c +++ b/checkpoint.c @@ -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 69b6a88..e902a89 100644 --- 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 f35e2e8..e065060 100644 --- 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 */