aboutsummaryrefslogtreecommitdiffstats
path: root/fs/f2fs/checkpoint.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-05-18 14:07:56 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2016-05-20 11:46:15 -0700
commit38f91ca8c0ea69f707c26f592dcc70f937088bcc (patch)
tree746c2c5769a93e49649b6d0b3a988c3c28c3319c /fs/f2fs/checkpoint.c
parentf2fs: avoid ENOSPC fault in the recovery process (diff)
downloadlinux-dev-38f91ca8c0ea69f707c26f592dcc70f937088bcc.tar.xz
linux-dev-38f91ca8c0ea69f707c26f592dcc70f937088bcc.zip
f2fs: flush pending bios right away when error occurs
Given errors, this patch flushes pending bios as soon as possible. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/checkpoint.c')
-rw-r--r--fs/f2fs/checkpoint.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/fs/f2fs/checkpoint.c b/fs/f2fs/checkpoint.c
index cf79598aec0e..389160049993 100644
--- a/fs/f2fs/checkpoint.c
+++ b/fs/f2fs/checkpoint.c
@@ -26,6 +26,14 @@
static struct kmem_cache *ino_entry_slab;
struct kmem_cache *inode_entry_slab;
+void f2fs_stop_checkpoint(struct f2fs_sb_info *sbi, bool end_io)
+{
+ set_ckpt_flags(sbi->ckpt, CP_ERROR_FLAG);
+ sbi->sb->s_flags |= MS_RDONLY;
+ if (!end_io)
+ f2fs_flush_merged_bios(sbi);
+}
+
/*
* We guarantee no failure on the returned page.
*/
@@ -91,7 +99,7 @@ repeat:
* meta page.
*/
if (unlikely(!PageUptodate(page)))
- f2fs_stop_checkpoint(sbi);
+ f2fs_stop_checkpoint(sbi, false);
out:
return page;
}