diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-11 18:37:46 -0700 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2014-08-21 13:55:05 -0700 |
commit | cf779cab14d50a84b61399f758da269654b863db (patch) | |
tree | c11a1da5ea17f3e3f86e5cdad7cc57b97427e7fa /fs/f2fs/node.c | |
parent | 8501017e50fb7586ba522a2913ce664d6c2024f6 (diff) | |
download | linux-stable-cf779cab14d50a84b61399f758da269654b863db.tar.gz linux-stable-cf779cab14d50a84b61399f758da269654b863db.tar.bz2 linux-stable-cf779cab14d50a84b61399f758da269654b863db.zip |
f2fs: handle EIO not to break fs consistency
There are two rules when EIO is occurred.
1. don't write any checkpoint data to preserve the previous checkpoint
2. don't lose the cached dentry/node/meta pages
So, at first, this patch adds set_page_dirty in f2fs_write_end_io's failure.
Then, writing checkpoint/dentry/node blocks is not allowed.
Note that, for the data pages, we can't just throw away by redirtying them.
Otherwise, kworker can fall into infinite loop to flush them.
(Ref. xfstests/019)
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/node.c')
-rw-r--r-- | fs/f2fs/node.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/node.c b/fs/f2fs/node.c index 9f126f80813d..d2f784283425 100644 --- a/fs/f2fs/node.c +++ b/fs/f2fs/node.c @@ -1215,6 +1215,8 @@ static int f2fs_write_node_page(struct page *page, if (unlikely(sbi->por_doing)) goto redirty_out; + if (unlikely(f2fs_cp_error(sbi))) + goto redirty_out; f2fs_wait_on_page_writeback(page, NODE); |