mirror of
https://github.com/team-infusion-developers/android_kernel_samsung_msm8976.git
synced 2024-09-21 11:53:01 +00:00
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: Yunlei He <heyunlei@huawei.com> Reviewed-by: Chao Yu <yuchao0@huawei.com> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
This commit is contained in:
parent
7b1f5e7531
commit
cd2822e19f
|
@ -731,6 +731,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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue