mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-01 06:33:07 +00:00
f2fs: fix normal discard process
[ Upstream commitb5f1a218ae
] In the DPOLICY_BG mode, there is a conflict between the two conditions "i + 1 < dpolicy->granularity" and "i < DEFAULT_DISCARD_GRANULARITY". If i = 15, the first condition is false, it will enter the second condition and dispatch all small granularity discards in function __issue_discard_cmd_orderly. The restrictive effect of the first condition to small discards will be invalidated. These two conditions should align. Fixes:20ee438232
("f2fs: issue small discard by LBA order") Signed-off-by: Dongdong Zhang <zhangdongdong1@oppo.com> Reviewed-by: Chao Yu <chao@kernel.org> Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
7e7db55d1e
commit
fa2e65c1b1
1 changed files with 1 additions and 1 deletions
|
@ -1448,7 +1448,7 @@ static int __issue_discard_cmd(struct f2fs_sb_info *sbi,
|
||||||
if (i + 1 < dpolicy->granularity)
|
if (i + 1 < dpolicy->granularity)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
if (i < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered)
|
if (i + 1 < DEFAULT_DISCARD_GRANULARITY && dpolicy->ordered)
|
||||||
return __issue_discard_cmd_orderly(sbi, dpolicy);
|
return __issue_discard_cmd_orderly(sbi, dpolicy);
|
||||||
|
|
||||||
pend_list = &dcc->pend_list[i];
|
pend_list = &dcc->pend_list[i];
|
||||||
|
|
Loading…
Reference in a new issue