Skip to contentSkip to conversation

f2fs: don't skip checkpoint if there is no dirty node pages

PATCH In review Jaegeuk Kim 2 participants 3 messages Aug 19, 2014 – Aug 20, 2014

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 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
index 633315a..60e3554 100644
@@ -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)
author maintainer
#1 lore raw

PATCH 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
index 7e1c13b..f14af91 100644
@@ -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
index 60e3554..7a54779 100644
@@ -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)


------------------------------------------------------------------------------
Reviewed-by on v1 2/2
#2 lore raw

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: trigger release_dirty_inode in f2fs_put_super

Quoted 5 lines

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.

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
index 7e1c13b..f14af91 100644
@@ -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
index 60e3554..7a54779 100644
@@ -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