* [PATCH 1/2] f2fs: don't skip checkpoint if there is no dirty node pages
@ 2014-08-19 16:52 Jaegeuk Kim
2014-08-19 16:52 ` [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super Jaegeuk Kim
0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2014-08-19 16:52 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim
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.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/super.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 633315a..60e3554 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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);
--
1.8.5.2 (Apple Git-48)
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super
2014-08-19 16:52 [PATCH 1/2] f2fs: don't skip checkpoint if there is no dirty node pages Jaegeuk Kim
@ 2014-08-19 16:52 ` Jaegeuk Kim
2014-08-20 9:33 ` [f2fs-dev] " Chao Yu
0 siblings, 1 reply; 3+ messages in thread
From: Jaegeuk Kim @ 2014-08-19 16:52 UTC (permalink / raw)
To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim
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.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
fs/f2fs/checkpoint.c | 2 +-
fs/f2fs/super.c | 3 +++
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index 7e1c13b..f14af91 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -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;
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index 60e3554..7a54779 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -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)
------------------------------------------------------------------------------
^ permalink raw reply related [flat|nested] 3+ messages in thread
* RE: [f2fs-dev] [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super
2014-08-19 16:52 ` [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super Jaegeuk Kim
@ 2014-08-20 9:33 ` Chao Yu
0 siblings, 0 replies; 3+ messages in thread
From: Chao Yu @ 2014-08-20 9:33 UTC (permalink / raw)
To: 'Jaegeuk Kim'; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel
> -----Original Message-----
> From: Jaegeuk Kim [mailto:jaegeuk@kernel.org]
> Sent: Wednesday, August 20, 2014 12:53 AM
> To: linux-kernel@vger.kernel.org; linux-fsdevel@vger.kernel.org;
> linux-f2fs-devel@lists.sourceforge.net
> Cc: Jaegeuk Kim
> Subject: [f2fs-dev] [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.
>
> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Looks good to me now, add this please:
Reviewed-by: Chao Yu <chao2.yu@samsung.com>
> ---
> fs/f2fs/checkpoint.c | 2 +-
> fs/f2fs/super.c | 3 +++
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
> index 7e1c13b..f14af91 100644
> --- a/fs/f2fs/checkpoint.c
> +++ b/fs/f2fs/checkpoint.c
> @@ -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;
> diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
> index 60e3554..7a54779 100644
> --- a/fs/f2fs/super.c
> +++ b/fs/f2fs/super.c
> @@ -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
> Linux-f2fs-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-08-20 9:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-08-19 16:52 [PATCH 1/2] f2fs: don't skip checkpoint if there is no dirty node pages Jaegeuk Kim
2014-08-19 16:52 ` [PATCH 2/2] f2fs: trigger release_dirty_inode in f2fs_put_super Jaegeuk Kim
2014-08-20 9:33 ` [f2fs-dev] " Chao Yu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).