]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix normal discard process
authorDongdong Zhang <zhangdongdong1@oppo.com>
Tue, 25 Oct 2022 09:40:36 +0000 (17:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 18 Jan 2023 10:41:17 +0000 (11:41 +0100)
commitd0818f81a0ca3daf09fd140f0e468af61e71232d
tree4af3266a002b7cd17e8405dd3e4c247c0667f332
parent418e417f84876c2c7b77e2e15a38dfa56fd96be7
f2fs: fix normal discard process

[ Upstream commit e415bff19cff207f57b32b83ea1cb765fa166f76 ]

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: a81712e9699f ("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>
fs/f2fs/segment.c