]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs: fix log recovery when unknown rocompat bits are set
authorDarrick J. Wong <djwong@kernel.org>
Tue, 14 Nov 2023 09:48:07 +0000 (10:48 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 14 Nov 2023 12:32:51 +0000 (13:32 +0100)
Source kernel 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>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
libxfs/xfs_sb.c

index 1e71d43d0a45c61eaf57fc85f8722740b6e034b4..01935017cb6ed5f7f7be837dcd45568a8e7868c7 100644 (file)
@@ -264,7 +264,8 @@ xfs_validate_sb_write(
                return -EFSCORRUPTED;
        }
 
-       if (xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
+       if (!xfs_is_readonly(mp) &&
+           xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
                xfs_alert(mp,
 "Corruption detected in superblock read-only compatible features (0x%x)!",
                        (sbp->sb_features_ro_compat &