diff options
author | Chao Yu <yuchao0@huawei.com> | 2018-01-25 18:57:27 +0800 |
---|---|---|
committer | Jaegeuk Kim <jaegeuk@kernel.org> | 2018-01-25 10:40:10 -0800 |
commit | 3b60d802d9828f99db83c3ca4fd99a5fa3fce884 (patch) | |
tree | 466f28c155385b005742488204d6f284b130cab8 /fs/f2fs/segment.c | |
parent | 6819b884e0eea641a2678be01a41a071efcfd489 (diff) | |
download | lwn-3b60d802d9828f99db83c3ca4fd99a5fa3fce884.tar.gz lwn-3b60d802d9828f99db83c3ca4fd99a5fa3fce884.zip |
f2fs: stop issuing discard if fs is readonly
If filesystem is readonly, stop to issue discard in daemon.
Signed-off-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r-- | fs/f2fs/segment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c index 9c09e2c96705..ca1f567f701a 100644 --- a/fs/f2fs/segment.c +++ b/fs/f2fs/segment.c @@ -1406,6 +1406,8 @@ static int issue_discard_thread(void *data) msecs_to_jiffies(wait_ms)); if (try_to_freeze()) continue; + if (f2fs_readonly(sbi->sb)) + continue; if (kthread_should_stop()) return 0; |