f2fs: avoid infinite loop in f2fs_alloc_nid
authorJaegeuk Kim <jaegeuk@kernel.org>
Wed, 19 Sep 2018 22:45:19 +0000 (15:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:47:10 +0000 (18:47 +0100)
commitc783946ea9b1f251948b754999d6c9958e8e2b36
tree7708620612f64b9739ef3691daed2d0f6db2b402
parentcaab324d1b018feff5b3a4256b715afbe9591620
f2fs: avoid infinite loop in f2fs_alloc_nid

[ Upstream commit f84262b0862d43b71b3e80a036cdd9d82e620367 ]

If we have an error in f2fs_build_free_nids, we're able to fall into a loop
to find free nids.

Suggested-by: Chao Yu <chao@kernel.org>
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/node.c