]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
xfs: fix log recovery when unknown rocompat bits are set
authorDarrick J. Wong <djwong@kernel.org>
Mon, 11 Sep 2023 15:42:35 +0000 (08:42 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2024 18:51:22 +0000 (19:51 +0100)
commitbac5a74c31c218d54303b014b6184b4c63bea11a
tree5d27b04c675a0f8ba89d4dd068a30ec3bf10c4c5
parent584754f983d3a49e6bc58648b7d564fd6b5476de
xfs: fix log recovery when unknown rocompat bits are set

[ Upstream commit 74ad4693b6473950e971b3dc525b5ee7570e05d0 ]

Log recovery has always run on read only mounts, even where the primary
superblock advertises unknown rocompat bits.  Due to a misunderstanding
between Eric and Darrick back in 2018, we accidentally changed the
superblock write verifier to shutdown the fs over that exact scenario.
As a result, the log cleaning that occurs at the end of the mounting
process fails if there are unknown rocompat bits set.

As we now allow writing of the superblock if there are unknown rocompat
bits set on a RO mount, we no longer want to turn off RO state to allow
log recovery to succeed on a RO mount.  Hence we also remove all the
(now unnecessary) RO state toggling from the log recovery path.

Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier"
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Dave Chinner <dchinner@redhat.com>
Stable-dep-of: 652f03db897b ("xfs: remove unknown compat feature check in superblock write validation")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/xfs/libxfs/xfs_sb.c
fs/xfs/xfs_log.c