]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
xfs: improve the assert at the top of xfs_log_cover
authorChristoph Hellwig <hch@lst.de>
Fri, 9 Jan 2026 15:18:21 +0000 (16:18 +0100)
committerCarlos Maiolino <cem@kernel.org>
Tue, 13 Jan 2026 09:36:23 +0000 (10:36 +0100)
Move each condition into a separate assert so that we can see which
on triggered.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Carlos Maiolino <cem@kernel.org>
fs/xfs/xfs_log.c

index a311385b23d8b44813341c44f52d935c990577cf..d4544ccafea5d5dc946b0d659e7aab641d061d85 100644 (file)
@@ -1180,9 +1180,11 @@ xfs_log_cover(
        int                     error = 0;
        bool                    need_covered;
 
-       ASSERT((xlog_cil_empty(mp->m_log) && xlog_iclogs_empty(mp->m_log) &&
-               !xfs_ail_min_lsn(mp->m_log->l_ailp)) ||
-               xlog_is_shutdown(mp->m_log));
+       if (!xlog_is_shutdown(mp->m_log)) {
+               ASSERT(xlog_cil_empty(mp->m_log));
+               ASSERT(xlog_iclogs_empty(mp->m_log));
+               ASSERT(!xfs_ail_min_lsn(mp->m_log->l_ailp));
+       }
 
        if (!xfs_log_writable(mp))
                return 0;