]> git.baikalelectronics.ru Git - kernel.git/commit
f2fs: fix to account FS_CP_DATA_IO correctly
authorChao Yu <chao@kernel.org>
Wed, 14 Sep 2022 13:28:46 +0000 (21:28 +0800)
committerJaegeuk Kim <jaegeuk@kernel.org>
Tue, 4 Oct 2022 20:31:44 +0000 (13:31 -0700)
commit1bce42d2451ad8e59d9c451577eb3776fcb3d036
tree6747a0fcfacd0d1c6d315e89f79da9067c391969
parente1b475d247bcf2c53f1742dee36432bf5df3faa9
f2fs: fix to account FS_CP_DATA_IO correctly

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

However, cp_task usage coverage has been increased due to below
commits:
commit 95ca13a757ec ("f2fs: fix to avoid deadloop if data_flush is on")
commit dc2e5735b102 ("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: 95ca13a757ec ("f2fs: fix to avoid deadloop if data_flush is on")
Fixes: dc2e5735b102 ("f2fs: fix potential recursive call when enabling data_flush")
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/data.c
fs/f2fs/f2fs.h
fs/f2fs/segment.c