summaryrefslogtreecommitdiffstats
path: root/fs/f2fs/segment.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/f2fs/segment.c')
-rw-r--r--fs/f2fs/segment.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/fs/f2fs/segment.c b/fs/f2fs/segment.c
index 33cb8aa5ec8f..ad48f1f16387 100644
--- a/fs/f2fs/segment.c
+++ b/fs/f2fs/segment.c
@@ -1762,7 +1762,8 @@ static int issue_discard_thread(void *data)
if (!atomic_read(&dcc->discard_cmd_cnt))
continue;
- if (sbi->gc_mode == GC_URGENT_HIGH)
+ if (sbi->gc_mode == GC_URGENT_HIGH ||
+ !f2fs_available_free_memory(sbi, DISCARD_CACHE))
__init_discard_policy(sbi, &dpolicy, DPOLICY_FORCE, 1);
sb_start_intwrite(sbi->sb);