diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-01-18 10:23:29 +0100 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-22 23:56:55 +0100 |
commit | 7950e9ac638e84518fbdd5c930939ad46a1068c5 (patch) | |
tree | 3ea4ea87d4151ed5929609caa7a5d3631b2ac00e /fs/f2fs/file.c | |
parent | f2fs: hanlde error case in f2fs_ioc_shutdown (diff) | |
download | linux-7950e9ac638e84518fbdd5c930939ad46a1068c5.tar.xz linux-7950e9ac638e84518fbdd5c930939ad46a1068c5.zip |
f2fs: stop gc/discard thread after fs shutdown
Once filesystem shuts down, daemons like gc/discard thread should be
aware of it, and do exit, in addtion, drop all cached pending discard
commands and turn off real-time discard mode.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/file.c')
-rw-r--r-- | fs/f2fs/file.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/fs/f2fs/file.c b/fs/f2fs/file.c index e20b01acbd2c..84306c718e68 100644 --- a/fs/f2fs/file.c +++ b/fs/f2fs/file.c @@ -1866,6 +1866,13 @@ static int f2fs_ioc_shutdown(struct file *filp, unsigned long arg) ret = -EINVAL; goto out; } + + stop_gc_thread(sbi); + stop_discard_thread(sbi); + + drop_discard_cmd(sbi); + clear_opt(sbi, DISCARD); + f2fs_update_time(sbi, REQ_TIME); out: mnt_drop_write_file(filp); |