gfs2: Improve gfs2_make_fs_rw error handling
authorAndreas Gruenbacher <agruenba@redhat.com>
Tue, 31 Jan 2023 14:06:53 +0000 (15:06 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 10 Mar 2023 08:39:53 +0000 (09:39 +0100)
commitc713ebf2fe3f469e4af4de60a3427689ffb7c5d7
tree3de499b4c3ff66be064fd242a5382f0b4ba7f8c6
parenta4b3893e41839ea3768176cfb1ddf4155671d79a
gfs2: Improve gfs2_make_fs_rw error handling

[ Upstream commit b66f723bb552ad59c2acb5d45ea45c890f84498b ]

In gfs2_make_fs_rw(), make sure to call gfs2_consist() to report an
inconsistency and mark the filesystem as withdrawn when
gfs2_find_jhead() fails.

At the end of gfs2_make_fs_rw(), when we discover that the filesystem
has been withdrawn, make sure we report an error.  This also replaces
the gfs2_withdrawn() check after gfs2_find_jhead().

Reported-by: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: syzbot+f51cb4b9afbd87ec06f2@syzkaller.appspotmail.com
Signed-off-by: Andreas Gruenbacher <agruenba@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/gfs2/super.c