nilfs2: flush palloc cache before manipulating data pages of GC dat
authorRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Sun, 15 Nov 2009 11:13:21 +0000 (20:13 +0900)
committerRyusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
Fri, 20 Nov 2009 01:05:50 +0000 (10:05 +0900)
Data pages in gcdat metadata file (i.e. the secondary DAT for GC), are
cleared or even moved back to the normal DAT when a shot of garbage
collection was done.

Buffer heads held by the palloc cache of gcdat must be cleared before
these page cache manipulation.  This adds nilfs_palloc_clear_cache()
to ensure this.

Signed-off-by: Ryusuke Konishi <konishi.ryusuke@lab.ntt.co.jp>
fs/nilfs2/gcdat.c

index 93383c5..dd5f7e0 100644 (file)
@@ -61,6 +61,8 @@ void nilfs_commit_gcdat_inode(struct the_nilfs *nilfs)
 
        nilfs_bmap_commit_gcdat(gii->i_bmap, dii->i_bmap);
 
+       nilfs_palloc_clear_cache(dat);
+       nilfs_palloc_clear_cache(gcdat);
        nilfs_clear_dirty_pages(mapping);
        nilfs_copy_back_pages(mapping, gmapping);
        /* note: mdt dirty flags should be cleared by segctor. */
@@ -79,6 +81,7 @@ void nilfs_clear_gcdat_inode(struct the_nilfs *nilfs)
        gcdat->i_state = I_CLEAR;
        gii->i_flags = 0;
 
+       nilfs_palloc_clear_cache(gcdat);
        truncate_inode_pages(gcdat->i_mapping, 0);
        truncate_inode_pages(&gii->i_btnode_cache, 0);
 }