summaryrefslogtreecommitdiff
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorJaegeuk Kim <jaegeuk@kernel.org>2015-06-15 14:52:29 -0700
committerJaegeuk Kim <jaegeuk@kernel.org>2015-08-04 14:09:53 -0700
commiteca616f8c1d6c581f3785f0ee3e2a3887e084273 (patch)
tree0b8febd0c98fa666397ea9adcf351db669a1f91d /fs/f2fs/super.c
parent5ac9f36fcacd532b218db1e0fd0f9e8a18321f22 (diff)
f2fs: avoid freed stat information
The write_checkpoint can update stat information, so we should destroy the stat structure after it. Reviewed-by: Chao Yu <chao2.yu@samsung.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/super.c')
-rw-r--r--fs/f2fs/super.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index a06b0b46fe69..da277100dc90 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -498,7 +498,6 @@ static void f2fs_put_super(struct super_block *sb)
}
kobject_del(&sbi->s_kobj);
- f2fs_destroy_stats(sbi);
stop_gc_thread(sbi);
/*
@@ -514,6 +513,9 @@ static void f2fs_put_super(struct super_block *sb)
write_checkpoint(sbi, &cpc);
}
+ /* write_checkpoint can update stat informaion */
+ f2fs_destroy_stats(sbi);
+
/*
* normally superblock is clean, so we need to release this.
* In addition, EIO will skip do checkpoint, we need this as well.