Commit c7b41e16 authored by Yunlei He's avatar Yunlei He Committed by Jaegeuk Kim

f2fs: avoid mismatching block range for discard

This patch skip discard block range smaller than trim_minlen,
and can not be merged by neighbour
Signed-off-by: default avatarYunlei He <heyunlei@huawei.com>
Reviewed-by: default avatarChao Yu <yuchao0@huawei.com>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
parent 3e6d0b4d
......@@ -672,6 +672,10 @@ static void add_discard_addrs(struct f2fs_sb_info *sbi, struct cp_control *cpc)
break;
end = __find_rev_next_zero_bit(dmap, max_blocks, start + 1);
if (force && start && end != max_blocks
&& (end - start) < cpc->trim_minlen)
continue;
__add_discard_entry(sbi, cpc, se, start, end);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment