f2fs: don't skip checkpoint if there is no dirty node pages
Subsystems (2)
Jaegeuk Kim
maintainerPATCH 1/2 f2fs: don't skip checkpoint if there is no dirty node pages
This is the errorneous scenario.
1. write data
2. do checkpoint
3. produce some dirty node pages by the gc thread
4. write back dirty node pages
5. f2fs_put_super will skip the checkpoint, since dirty count for node pages is zero.
This patch removes such the wrong condition check.
--- fs/f2fs/super.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/f2fs/super.c +1 -1
@@ -432,7 +432,7 @@ static void f2fs_put_super(struct super_block *sb)stop_gc_thread (sbi);/* We don't need to do checkpoint when it's clean */ -if (sbi->s_dirty &&get_pages (sbi,F2FS_DIRTY_NODES )) +if (sbi->s_dirty)write_checkpoint (sbi, true);iput (sbi->node_inode);
Signature · 1 line
1.8.5.2 (Apple Git-48)
Jaegeuk Kim
maintainerPATCH 2/2 f2fs: trigger release_dirty_inode in f2fs_put_super
The generic_shutdown_super calls sync_filesystem, evict_inode, and then f2fs_put_super. In f2fs_evict_inode, we remain some dirty inode information so we should release them at f2fs_put_super.
--- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/super.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)
fs/f2fs/checkpoint.c +1 -1
@@ -348,7 +348,7 @@ bool exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode)return e ? true : false; } -static void release_dirty_inode (struct f2fs_sb_info *sbi) +void release_dirty_inode (struct f2fs_sb_info *sbi) {struct ino_entry *e, *tmp;int i;
fs/f2fs/super.c +3 -0
@@ -435,6 +435,9 @@ static void f2fs_put_super(struct super_block *sb)if (sbi->s_dirty)write_checkpoint (sbi, true); +/* normally superblock is clean, so we need to release this */ +release_dirty_inode (sbi); +iput (sbi->node_inode);iput (sbi->meta_inode);
Signature · 4 lines
1.8.5.2 (Apple Git-48) ------------------------------------------------------------------------------
RE: [f2fs-dev] [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super
Quoted 8 lines
-----Original Message-----
From: Jaegeuk Kim [mailto:[email protected]]
Sent: Wednesday, August 20, 2014 12:53 AM
To: [email protected]; [email protected]; [email protected]
Cc: Jaegeuk Kim
Subject: [f2fs-dev] [PATCH 2/2] f2fs: triggerrelease_dirty_inodeinf2fs_put_super
Quoted 5 lines
The
generic_shutdown_supercallssync_filesystem,evict_inode, and thenf2fs_put_super. Inf2fs_evict_inode, we remain some dirty inode information so we should release them atf2fs_put_super.Signed-off-by Jaegeuk Kim <[email protected]>
Looks good to me now, add this please:
Quoted 41 lines
--- fs/f2fs/checkpoint.c | 2 +- fs/f2fs/super.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-)fs/f2fs/checkpoint.c +1
-1@@ -348,7 +348,7 @@ bool exist_written_data(struct f2fs_sb_info *sbi, nid_t ino, int mode)return e ? true : false; } -static void release_dirty_inode (struct f2fs_sb_info *sbi) +void release_dirty_inode (struct f2fs_sb_info *sbi) {struct ino_entry *e, *tmp;int i;fs/f2fs/super.c +3
-1@@ -435,6 +435,9 @@ static void f2fs_put_super(struct super_block *sb)if (sbi->s_dirty)write_checkpoint (sbi, true); +/* normally superblock is clean, so we need to release this */ +release_dirty_inode (sbi); +iput (sbi->node_inode);iput (sbi->meta_inode); --1.8.5.2 (Apple Git-48)
------------------------------------------------------------------------------
_______________________________________________
Linux-f2fs-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel