Skip to content

Commit 652f03d

Browse files
Long Licmaiolino
authored andcommitted
xfs: remove unknown compat feature check in superblock write validation
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: 9e037cb ("xfs: check for unknown v5 feature bits in superblock write verifier") Cc: [email protected] # v4.19+ Signed-off-by: Long Li <[email protected]> Reviewed-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]> Signed-off-by: Carlos Maiolino <[email protected]>
1 parent 45f69d0 commit 652f03d

File tree

1 file changed

+0
-7
lines changed

1 file changed

+0
-7
lines changed

fs/xfs/libxfs/xfs_sb.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -326,13 +326,6 @@ xfs_validate_sb_write(
326326
* the kernel cannot support since we checked for unsupported bits in
327327
* the read verifier, which means that memory is corrupt.
328328
*/
329-
if (xfs_sb_has_compat_feature(sbp, XFS_SB_FEAT_COMPAT_UNKNOWN)) {
330-
xfs_warn(mp,
331-
"Corruption detected in superblock compatible features (0x%x)!",
332-
(sbp->sb_features_compat & XFS_SB_FEAT_COMPAT_UNKNOWN));
333-
return -EFSCORRUPTED;
334-
}
335-
336329
if (!xfs_is_readonly(mp) &&
337330
xfs_sb_has_ro_compat_feature(sbp, XFS_SB_FEAT_RO_COMPAT_UNKNOWN)) {
338331
xfs_alert(mp,

0 commit comments

Comments
 (0)