Skip to content

Commit 6d7c865

Browse files
author
Jaegeuk Kim
committed
f2fs: avoid inifinite loop to wait for flushing node pages at cp_error
Shutdown test is somtimes hung, since it keeps trying to flush dirty node pages in an inifinite loop. Let's drop dirty pages at umount in that case. Signed-off-by: Jaegeuk Kim <[email protected]>
1 parent 9c30df7 commit 6d7c865

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

fs/f2fs/node.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1520,8 +1520,15 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
15201520

15211521
trace_f2fs_writepage(page, NODE);
15221522

1523-
if (unlikely(f2fs_cp_error(sbi)))
1523+
if (unlikely(f2fs_cp_error(sbi))) {
1524+
if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) {
1525+
ClearPageUptodate(page);
1526+
dec_page_count(sbi, F2FS_DIRTY_NODES);
1527+
unlock_page(page);
1528+
return 0;
1529+
}
15241530
goto redirty_out;
1531+
}
15251532

15261533
if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
15271534
goto redirty_out;

0 commit comments

Comments
 (0)