summaryrefslogtreecommitdiffstats
path: root/fs/f2fs
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2020-05-19 03:00:33 +0200
committerJaegeuk Kim <jaegeuk@kernel.org>2020-05-25 05:54:34 +0200
commit6d7c865c2714b122a940774990cfb1d87b57294a (patch)
tree20c6006e251dde584f7a90dac94486eb72f66640 /fs/f2fs
parentf2fs: flush dirty meta pages when flushing them (diff)
downloadlinux-6d7c865c2714b122a940774990cfb1d87b57294a.tar.xz
linux-6d7c865c2714b122a940774990cfb1d87b57294a.zip
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 <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs')
-rw-r--r--fs/f2fs/node.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c
index e632de10aeda..e0bb0f7e0506 100644
--- a/fs/f2fs/node.c
+++ b/fs/f2fs/node.c
@@ -1520,8 +1520,15 @@ static int __write_node_page(struct page *page, bool atomic, bool *submitted,
trace_f2fs_writepage(page, NODE);
- if (unlikely(f2fs_cp_error(sbi)))
+ if (unlikely(f2fs_cp_error(sbi))) {
+ if (is_sbi_flag_set(sbi, SBI_IS_CLOSE)) {
+ ClearPageUptodate(page);
+ dec_page_count(sbi, F2FS_DIRTY_NODES);
+ unlock_page(page);
+ return 0;
+ }
goto redirty_out;
+ }
if (unlikely(is_sbi_flag_set(sbi, SBI_POR_DOING)))
goto redirty_out;