diff options
author | Chao Yu <yuchao0@huawei.com> | 2017-09-29 13:59:39 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2017-10-10 12:49:53 -0700 |
commit | 1228b482c4ee26f3334dd83eb13bcf7e462f9c93 (patch) | |
tree | d455026d467bb992187396da2ba104c80dd19694 /fs/f2fs/super.c | |
parent | 39d787bec4f792e69e24b11aa3d61ae1c0e4830b (diff) |
f2fs: fix to flush multiple device in checkpoint
If f2fs manages multiple devices, in checkpoint, we need to issue flush
in those devices which contain dirty data/node in their cache before
we write checkpoint region, otherwise, filesystem metadata could be
corrupted if hitting SPO after checkpoint.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 933c3d529e65..57e79cc2e792 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1965,6 +1965,9 @@ static void init_sb_info(struct f2fs_sb_info *sbi) for (j = HOT; j < NR_TEMP_TYPE; j++) mutex_init(&sbi->wio_mutex[i][j]); spin_lock_init(&sbi->cp_lock); + + sbi->dirty_device = 0; + spin_lock_init(&sbi->dev_lock); } static int init_percpu_info(struct f2fs_sb_info *sbi) |