xfs: improve the assert at the top of xfs_log_cover
PATCH 1/1 xfs: improve the assert at the top of xfs_log_cover
Move each condition into a separate assert so that we can see which on triggered.
Signed-off-by Christoph Hellwig <[email protected]>
--- fs/xfs/xfs_log.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
fs/xfs/xfs_log.c +5 -3
@@ -1138,9 +1138,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 ;
Signature · 1 line
2.47.3
Quoted 4 lines · Christoph Hellwig
Move each condition into a separate assert so that we can see which on triggered.
Signed-off-by Christoph Hellwig <[email protected]>
Yes that's really helpful for observability;
Reviewed-by "Darrick J. Wong" <[email protected]>
--D
Quoted 27 lines
--- fs/xfs/xfs_log.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)fs/xfs/xfs_log.c +5
-3@@ -1138,9 +1138,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 ;Signature · 1 line
2.47.3
Quoted 4 lines · Christoph Hellwig
Move each condition into a separate assert so that we can see which on triggered.
Applied to for-next, thanks!
[1/1] xfs: improve the assert at the top of xfs_log_cover
commit: df7ec7226fbe14d8654193933da81b2470cc5814
Best regards,
Signature · 1 line
Carlos Maiolino <[email protected]>