提交 b28c3f94 编写于 作者: C Chao Yu 提交者: Jaegeuk Kim

f2fs: fix to issue small discard in real-time mode discard

Now in f2fs, we share functions and structures for batch mode and real-time mode
discard. For real-time mode discard, in shared function add_discard_addrs, we
will use uninitialized trim_minlen in struct cp_control to compare with length
of contiguous free blocks to decide whether skipping discard fragmented freespace
or not, this makes us ignore small discard sometimes. Fix it.
Signed-off-by: NChao Yu <chao2.yu@samsung.com>
Reviewed-by : Changman Lee <cm224.lee@samsung.com>
Signed-off-by: NJaegeuk Kim <jaegeuk@kernel.org>
上级 7ecebe5e
...@@ -552,7 +552,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc) ...@@ -552,7 +552,7 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc)
end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1); end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1);
if (end - start < cpc->trim_minlen) if (force && end - start < cpc->trim_minlen)
continue; continue;
__add_discard_entry(sbi, cpc, start, end); __add_discard_entry(sbi, cpc, start, end);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册