linux-f2fs-devel.lists.sourceforge.net archive mirror
 help / color / mirror / Atom feed
* [PATCH] f2fs: remove dirty inode pages in error path
@ 2016-09-23 21:11 Jaegeuk Kim
  2016-09-24  1:02 ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2016-09-23 21:11 UTC (permalink / raw)
  To: linux-kernel, linux-fsdevel, linux-f2fs-devel; +Cc: Jaegeuk Kim

When getting EIO while handling orphan inodes, we can get some dirty node
pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
to flush node pages. But in this case, we should prevent to do that, since
we will try again from the start.

Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
---
 fs/f2fs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index e7bb153..fbded38 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -1892,6 +1892,7 @@ free_root_inode:
 	dput(sb->s_root);
 	sb->s_root = NULL;
 free_node_inode:
+	truncate_inode_pages_final(NODE_MAPPING(sbi));
 	mutex_lock(&sbi->umount_mutex);
 	release_ino_entry(sbi, true);
 	f2fs_leave_shrinker(sbi);
-- 
2.8.3

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: remove dirty inode pages in error path
  2016-09-23 21:11 [PATCH] f2fs: remove dirty inode pages in error path Jaegeuk Kim
@ 2016-09-24  1:02 ` Chao Yu
  2016-09-24 17:47   ` Jaegeuk Kim
  0 siblings, 1 reply; 4+ messages in thread
From: Chao Yu @ 2016-09-24  1:02 UTC (permalink / raw)
  To: Jaegeuk Kim, linux-kernel, linux-fsdevel, linux-f2fs-devel

On 2016/9/24 5:11, Jaegeuk Kim wrote:
> When getting EIO while handling orphan inodes, we can get some dirty node
> pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
> to flush node pages. But in this case, we should prevent to do that, since
> we will try again from the start.

We are protected since we set SBI_POR_DOING flag in sb, so we are safe now?

Thanks,

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: remove dirty inode pages in error path
  2016-09-24  1:02 ` Chao Yu
@ 2016-09-24 17:47   ` Jaegeuk Kim
  2016-09-26  1:04     ` Chao Yu
  0 siblings, 1 reply; 4+ messages in thread
From: Jaegeuk Kim @ 2016-09-24 17:47 UTC (permalink / raw)
  To: Chao Yu; +Cc: linux-fsdevel, linux-kernel, linux-f2fs-devel

On Sat, Sep 24, 2016 at 09:02:02AM +0800, Chao Yu wrote:
> On 2016/9/24 5:11, Jaegeuk Kim wrote:
> > When getting EIO while handling orphan inodes, we can get some dirty node
> > pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
> > to flush node pages. But in this case, we should prevent to do that, since
> > we will try again from the start.
> 
> We are protected since we set SBI_POR_DOING flag in sb, so we are safe now?

Safe, but we get an infinite loop to flush node pages.

> 
> Thanks,

------------------------------------------------------------------------------

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] f2fs: remove dirty inode pages in error path
  2016-09-24 17:47   ` Jaegeuk Kim
@ 2016-09-26  1:04     ` Chao Yu
  0 siblings, 0 replies; 4+ messages in thread
From: Chao Yu @ 2016-09-26  1:04 UTC (permalink / raw)
  To: Jaegeuk Kim; +Cc: linux-kernel, linux-fsdevel, linux-f2fs-devel

On 2016/9/25 1:47, Jaegeuk Kim wrote:
> On Sat, Sep 24, 2016 at 09:02:02AM +0800, Chao Yu wrote:
>> On 2016/9/24 5:11, Jaegeuk Kim wrote:
>>> When getting EIO while handling orphan inodes, we can get some dirty node
>>> pages. Then, f2fs_write_node_pages() called by iput(node_inode) will try
>>> to flush node pages. But in this case, we should prevent to do that, since
>>> we will try again from the start.
>>
>> We are protected since we set SBI_POR_DOING flag in sb, so we are safe now?
> 
> Safe, but we get an infinite loop to flush node pages.

Got it.

Thanks,

> 
>>
>> Thanks,
> 
> .
> 


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-09-26  1:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-23 21:11 [PATCH] f2fs: remove dirty inode pages in error path Jaegeuk Kim
2016-09-24  1:02 ` Chao Yu
2016-09-24 17:47   ` Jaegeuk Kim
2016-09-26  1:04     ` 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).