f2fs: fix wrong condition to trigger background checkpoint correctly
authorChao Yu <chao@kernel.org>
Tue, 28 Sep 2021 19:19:14 +0000 (03:19 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:31 +0000 (09:48 +0100)
commit7228ed3293e0fbe5beb2c8c71a470f62ebc8db7d
treeca5cbc8616f7abb20285796c499a6db2798cbd03
parent9ad4e63e3cca9f41bdc8850a19a207a0b009344c
f2fs: fix wrong condition to trigger background checkpoint correctly

[ Upstream commit cd6d697a6e2013a0a85f8b261b16c8cfd50c1f5f ]

In f2fs_balance_fs_bg(), it needs to check both NAT_ENTRIES and INO_ENTRIES
memory usage to decide whether we should skip background checkpoint, otherwise
we may always skip checking INO_ENTRIES memory usage, so that INO_ENTRIES may
potentially cause high memory footprint.

Fixes: 493720a48543 ("f2fs: fix to avoid REQ_TIME and CP_TIME collision")
Signed-off-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