Commit 8308f7b5 authored by Chao Yu's avatar Chao Yu Committed by Jialin Zhang
Browse files

f2fs: fix to account FS_CP_DATA_IO correctly

stable inclusion
from stable-v5.10.150
commit b60aa21e2f3ab0cfccefcd3f4963d184ec801eea
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/I6D0XA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=b60aa21e2f3ab0cfccefcd3f4963d184ec801eea



--------------------------------

[ Upstream commit d80afefb ]

f2fs_inode_info.cp_task was introduced for FS_CP_DATA_IO accounting
since commit b0af6d49 ("f2fs: add app/fs io stat").

However, cp_task usage coverage has been increased due to below
commits:
commit 040d2bb3 ("f2fs: fix to avoid deadloop if data_flush is on")
commit 186857c5 ("f2fs: fix potential recursive call when enabling data_flush")

So that, if data_flush mountoption is on, when data flush was
triggered from background, the IO from data flush will be accounted
as checkpoint IO type incorrectly.

In order to fix this issue, this patch splits cp_task into two:
a) cp_task: used for IO accounting
b) wb_task: used to avoid deadlock

Fixes: 040d2bb3 ("f2fs: fix to avoid deadloop if data_flush is on")
Fixes: 186857c5 ("f2fs: fix potential recursive call when enabling data_flush")
Signed-off-by: default avatarChao Yu <chao@kernel.org>
Signed-off-by: default avatarJaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarJialin Zhang <zhangjialin11@huawei.com>
parent 871f643f
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment