f2fs: fix to unlock page correctly in error path of is_alive()
authorChao Yu <chao@kernel.org>
Fri, 4 Feb 2022 03:21:14 +0000 (11:21 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 8 Apr 2022 12:39:51 +0000 (14:39 +0200)
commitec67040703c8423473c419c2b5caa362f53efed6
tree42fc678ecd6fd14d7f4027689d0974199bce32c1
parent7af164fa2f1abc577d357d22d83a2f3490875d7e
f2fs: fix to unlock page correctly in error path of is_alive()

commit 6d18762ed5cd549fde74fd0e05d4d87bac5a3beb upstream.

As Pavel Machek reported in below link [1]:

After commit 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()"),
node page should be unlock via calling f2fs_put_page() in the error path
of is_alive(), otherwise, f2fs may hang when it tries to lock the node
page, fix it.

[1] https://lore.kernel.org/stable/20220124203637.GA19321@duo.ucw.cz/

Fixes: 77900c45ee5c ("f2fs: fix to do sanity check in is_alive()")
Cc: <stable@vger.kernel.org>
Reported-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Pavel Machek <pavel@denx.de>
Signed-off-by: Chao Yu <chao@kernel.org>
Signed-off-by: Jaegeuk Kim <jaegeuk@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/f2fs/gc.c