f2fs: avoid race condition for shrinker count
authorJaegeuk Kim <jaegeuk@kernel.org>
Fri, 6 Nov 2020 21:22:05 +0000 (13:22 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Jan 2021 13:56:54 +0000 (14:56 +0100)
commitee3f8aefd0373f9d83ad975651281ec8ee2fa749
tree7146698dc5d64698d35a6fc022884eee50fed958
parent3c0f0f5f58a785fa373fc38200d16feded0ceb5b
f2fs: avoid race condition for shrinker count

[ Upstream commit a95ba66ac1457b76fe472c8e092ab1006271f16c ]

Light reported sometimes shinker gets nat_cnt < dirty_nat_cnt resulting in
wrong do_shinker work. Let's avoid to return insane overflowed value by adding
single tracking value.

Reported-by: Light Hsieh <Light.Hsieh@mediatek.com>
Reviewed-by: Chao Yu <yuchao0@huawei.com>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/f2fs/checkpoint.c
fs/f2fs/debug.c
fs/f2fs/f2fs.h
fs/f2fs/node.c
fs/f2fs/node.h
fs/f2fs/shrinker.c