diff options
author | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-12-07 16:23:32 -0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2016-12-07 18:56:50 -0800 |
commit | 5eba8c5d1fb3af28b2073ba5228d4998196c1bcc (patch) | |
tree | c873248bed74d949213de8a3c42438b2b8dfef14 /fs/f2fs/super.c | |
parent | a2125ff7dd1ed3a2a53cdc1f8f9c9cec9cfaa7ab (diff) |
f2fs: fix to access nullified flush_cmd_control pointer
f2fs_sync_file() remount_ro
- f2fs_readonly
- destroy_flush_cmd_control
- f2fs_issue_flush
- no fcc pointer!
So, this patch doesn't free fcc in this case, but just stop its kernel thread
which sends flush commands.
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r-- | fs/f2fs/super.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c index 1a526474b332..b62c10d28e06 100644 --- a/fs/f2fs/super.c +++ b/fs/f2fs/super.c @@ -1102,8 +1102,9 @@ static int f2fs_remount(struct super_block *sb, int *flags, char *data) * or if flush_merge is not passed in mount option. */ if ((*flags & MS_RDONLY) || !test_opt(sbi, FLUSH_MERGE)) { - destroy_flush_cmd_control(sbi); - } else if (!SM_I(sbi)->cmd_control_info) { + clear_opt(sbi, FLUSH_MERGE); + destroy_flush_cmd_control(sbi, false); + } else { err = create_flush_cmd_control(sbi); if (err) goto restore_gc; |