Skip to contentSkip to conversation

f2fs: remove dirty inode pages in error path

PATCH In review Jaegeuk Kim 2 participants 4 messages Sep 23, 2016 – Sep 26, 2016

Subsystems (2)
lore
Share & tools
lore

Jaegeuk Kim

author maintainer
#0 lore raw

PATCH 1/1 f2fs: remove dirty inode pages in error path

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.

---
 fs/f2fs/super.c | 1 +
 1 file changed, 1 insertion(+)
fs/f2fs/super.c +1 -0
index e7bb153..fbded38 100644
@@ -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);
Signature · 1 line
2.8.3
#1 lore raw
Quoted 4 lines · 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.

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

Thanks,

author maintainer
#2 lore raw
Quoted 7 lines · Chao Yu
Quoted 4 lines · 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.

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.

Quoted 2 lines

Thanks,

#3 lore raw
Quoted 10 lines · Jaegeuk Kim
Quoted 7 lines · Chao Yu
Quoted 4 lines · 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.

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,

Quoted 6 lines
Quoted 3 lines

Thanks,

.