summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/super.c
diff options
context:
space:
mode:
authorChao Yu <yuchao0@huawei.com>2017-06-29 23:17:45 +0800
committerJaegeuk Kim <jaegeuk@kernel.org>2017-07-07 10:34:42 -0700
commitcce1325247b9faafc520c5789fe60feef1fd7092 (patch)
treeb4b722ce5c23bb52fb36b9f9a291dc1314ea64e7 /fs/f2fs/super.c
parentdaeb433e42de97c79622f58681972200eec1d8da (diff)
downloadlinux-cce1325247b9faafc520c5789fe60feef1fd7092.tar.bz2
f2fs: stop gc/discard thread in prior during umount
This patch resolves kernel panic for xfstests/081, caused by recent f2fs_bug_on f2fs: add f2fs_bug_on in __remove_discard_cmd For fixing, we will stop gc/discard thread in prior in ->kill_sb in order to avoid referring and releasing race among them. Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> 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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index c45bac6f1795..f27c141cd8aa 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -566,8 +566,6 @@ static void f2fs_put_super(struct super_block *sb)
struct f2fs_sb_info *sbi = F2FS_SB(sb);
int i;
- stop_gc_thread(sbi);
-
/* prevent remaining shrinker jobs */
mutex_lock(&sbi->umount_mutex);
@@ -1976,8 +1974,11 @@ static struct dentry *f2fs_mount(struct file_system_type *fs_type, int flags,
static void kill_f2fs_super(struct super_block *sb)
{
- if (sb->s_root)
+ if (sb->s_root) {
set_sbi_flag(F2FS_SB(sb), SBI_IS_CLOSE);
+ stop_gc_thread(F2FS_SB(sb));
+ stop_discard_thread(F2FS_SB(sb));
+ }
kill_block_super(sb);
}