Linux 5.11 XFS Will Flag File-Systems In Need Of Repair
The XFS kernel code with Linux 5.11 and later will set the "needs repair" flag on a file-system when it's in a known state needing repair via the xfs_repair user-space utility. The updated xfs_repair utility will in turn clear that feature flag once the operation is complete. When needing a repair, xfs_admin should automatically run the repair operation so ideally the user/administrator will not need to issue the user-space command themselves.
While this flag can be used for various cases where the file-system may be known to be in a bad state, the motivation for "needs repair" is when it comes time to forcing users to upgrade the XFS file-system capabilities such as for upgrading it to handle XFS timestamps past the Year 2038.
With the prior Linux 5.10 kernel cycle they already announced XFS Version 4 file-system format will be deprecated in a decade and users when possible should begin upgrading to the Version 5 format. With the new feature flag, they will ultimately be able to force users to upgrade the file-system format by setting the "needs repair" flag when it comes time to forcing users to upgrade and removing the kernel support for the prior format.
The new feature flag was merged for Linux 5.11 along with other code clean-ups and fixes.