f2fs: handle EIO not to break fs consistency
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 12 Aug 2014 01:37:46 +0000 (18:37 -0700)
committerJaegeuk Kim <jaegeuk@kernel.org>
Thu, 21 Aug 2014 20:55:05 +0000 (13:55 -0700)
commitcf779cab14d50a84b61399f758da269654b863db
treec11a1da5ea17f3e3f86e5cdad7cc57b97427e7fa
parent8501017e50fb7586ba522a2913ce664d6c2024f6
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>
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/node.c
fs/f2fs/super.c