]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: remove unknown compat feature check in superblock write validation
authorLong Li <leo.lilong@huawei.com>
Wed, 13 Nov 2024 09:17:15 +0000 (17:17 +0800)
committerCarlos Maiolino <cem@kernel.org>
Fri, 22 Nov 2024 09:20:55 +0000 (10:20 +0100)
Compat features are new features that older kernels can safely ignore,
allowing read-write mounts without issues. The current sb write validation
implementation returns -EFSCORRUPTED for unknown compat features,
preventing filesystem write operations and contradicting the feature's
definition.

Additionally, if the mounted image is unclean, the log recovery may need
to write to the superblock. Returning an error for unknown compat features
during sb write validation can cause mount failures.

Although XFS currently does not use compat feature flags, this issue
affects current kernels' ability to mount images that may use compat
feature flags in the future.

Since superblock read validation already warns about unknown compat
features, it's unnecessary to repeat this warning during write validation.
Therefore, the relevant code in write validation is being removed.

Fixes: 9e037cb7972f ("xfs: check for unknown v5 feature bits in superblock write verifier")
Cc: stable@vger.kernel.org # v4.19+
Signed-off-by: Long Li <leo.lilong@huawei.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/libxfs/xfs_sb.c

index e81b240b71583e7940806badb0c0f37a9b708802..a809513a290cf4a4d150a7dc8d3a374f79b3ea7e 100644 (file)
@@ -326,13 +326,6 @@ xfs_validate_sb_write(
         * the kernel cannot support since we checked for unsupported bits in
         * the read verifier, which means that memory is corrupt.
         */
-       if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
-               xfs_warn(mp,
-"Corruption detected in superblock compatible features (0x%x)!",
-                       (sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
-               return -EFSCORRUPTED;
-       }
-
        if (!xfs_is_readonly(mp) &&
            xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
                xfs_alert(mp,