summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2016-12-08 03:23:32 +0300
committerJaegeuk Kim <jaegeuk@kernel.org>2016-12-08 05:56:50 +0300
commit5eba8c5d1fb3af28b2073ba5228d4998196c1bcc (patch)
treec873248bed74d949213de8a3c42438b2b8dfef14 /fs/f2fs/super.c
parenta2125ff7dd1ed3a2a53cdc1f8f9c9cec9cfaa7ab (diff)
downloadlinux-5eba8c5d1fb3af28b2073ba5228d4998196c1bcc.tar.xz
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.c5
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;