f2fs: handle EIO not to break fs consistency
authorJaegeuk Kim <jaegeuk@kernel.org>
Tue, 12 Aug 2014 01:37:46 +0000 (18:37 -0700)
committerIan Chang <ianc@nvidia.com>
Wed, 27 Jan 2016 10:04:10 +0000 (18:04 +0800)
commit6c99e425a9c0962a6eb9c180bd95698f40f7ef65
tree227c90c365df125e69bfda32ae67bc17afac4f29
parent2ab349e4d4a7d994a6660e5e841ce5bafa8f21e4
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>

Conflicts:
fs/f2fs/data.c

Change-Id: Ia54fd4792593d023603355cf255cbc8e12e53b93
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/node.c
fs/f2fs/super.c