public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: Christoph Hellwig <hch@lst.de>
Cc: cem@kernel.org, linux-xfs@vger.kernel.org
Subject: Re: [PATCH] xfs: improve the assert at the top of xfs_log_cover
Date: Fri, 9 Jan 2026 08:20:17 -0800	[thread overview]
Message-ID: <20260109162017.GO15551@frogsfrogsfrogs> (raw)
In-Reply-To: <20260109151827.2376883-1-hch@lst.de>

On Fri, Jan 09, 2026 at 04:18:21PM +0100, Christoph Hellwig wrote:
> Move each condition into a separate assert so that we can see which
> on triggered.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

Yes that's really helpful for observability;
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>

--D

> ---
>  fs/xfs/xfs_log.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index 511756429336..8ddd25970471 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -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;
> -- 
> 2.47.3
> 
> 

  reply	other threads:[~2026-01-09 16:20 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-09 15:18 [PATCH] xfs: improve the assert at the top of xfs_log_cover Christoph Hellwig
2026-01-09 16:20 ` Darrick J. Wong [this message]
2026-01-13 13:10 ` Carlos Maiolino

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260109162017.GO15551@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=cem@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox