7.3-stable review patch. If anyone has any objections, please let me know. ------------------ From: Darrick J. Wong commit 2b47be015a5e54f4a3d62afa636ba593de9b67f6 upstream. LOLLM observed that we should not allow repairs to proceed if the count of delayed-allocation realtime extents exceeds the number of free rt extents because we can't install negative numbers into the superblock. It's unclear how we could end up in that state in real life, but let's at least complain loudly about it if we ever encounter it. Cc: stable@vger.kernel.org # v6.2 Fixes: e74331d6fa2c21 ("xfs: online checking of the free rt extent count") Signed-off-by: Darrick J. Wong Assisted-by: LOLLM # finding obvious bugs Reviewed-by: Christoph Hellwig Signed-off-by: Carlos Maiolino Signed-off-by: Greg Kroah-Hartman --- fs/xfs/scrub/fscounters.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/fs/xfs/scrub/fscounters.c +++ b/fs/xfs/scrub/fscounters.c @@ -607,6 +607,13 @@ xchk_fscounters( try_again = true; } + if (!xfs_has_zoned(mp) && fsc->frextents < fsc->frextents_delayed) { + if (fsc->frozen) + xchk_set_incomplete(sc); + else + try_again = true; + } + if (!xfs_has_zoned(mp) && !xchk_fscount_within_range(sc, frextents, &mp->m_free[XC_FREE_RTEXTENTS].count,