public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Christoph Hellwig <hch@lst.de>
Cc: linux-xfs@vger.kernel.org, Dave Chinner <david@fromorbit.com>
Subject: Re: [PATCH 6/7] xfs: cleanup xlog_state_clean_iclog
Date: Fri, 6 Mar 2020 12:12:24 -0500	[thread overview]
Message-ID: <20200306171224.GI2773@bfoster> (raw)
In-Reply-To: <20200306143137.236478-7-hch@lst.de>

On Fri, Mar 06, 2020 at 07:31:36AM -0700, Christoph Hellwig wrote:
> Use the shutdown flag in the log to bypass the iclog processing
> instead of looking at the ioerror flag, and slightly simplify the
> while loop processing.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/xfs_log.c | 27 +++++++++++++--------------
>  1 file changed, 13 insertions(+), 14 deletions(-)
> 
> diff --git a/fs/xfs/xfs_log.c b/fs/xfs/xfs_log.c
> index d1accad13af4..fae5107099b1 100644
> --- a/fs/xfs/xfs_log.c
> +++ b/fs/xfs/xfs_log.c
> @@ -2582,30 +2582,29 @@ xlog_state_activate_iclog(
>   *
>   * Caller must hold the icloglock before calling us.
>   *
> - * State Change: !IOERROR -> DIRTY -> ACTIVE
> + * State Change: CALLBACK -> DIRTY -> ACTIVE
>   */
>  STATIC void
>  xlog_state_clean_iclog(
>  	struct xlog		*log,
>  	struct xlog_in_core	*dirty_iclog)
>  {
> -	struct xlog_in_core	*iclog;
>  	int			changed = 0;
>  
> -	/* Prepare the completed iclog. */
> -	if (dirty_iclog->ic_state != XLOG_STATE_IOERROR)
> -		dirty_iclog->ic_state = XLOG_STATE_DIRTY;
> +	if (!XLOG_FORCED_SHUTDOWN(log)) {
> +		struct xlog_in_core	*iclog = log->l_iclog;
>  
> -	/* Walk all the iclogs to update the ordered active state. */
> -	iclog = log->l_iclog;
> -	do {
> -		if (iclog->ic_state == XLOG_STATE_DIRTY)
> -			xlog_state_activate_iclog(iclog, &changed);
> -		else if (iclog->ic_state != XLOG_STATE_ACTIVE)
> -			break;
> -		iclog = iclog->ic_next;
> -	} while (iclog != log->l_iclog);
> +		/* Prepare the completed iclog. */
> +		dirty_iclog->ic_state = XLOG_STATE_DIRTY;
>  
> +		/* Walk all the iclogs to update the ordered active state. */
> +		do {
> +			if (iclog->ic_state == XLOG_STATE_DIRTY)
> +				xlog_state_activate_iclog(iclog, &changed);
> +			else if (iclog->ic_state != XLOG_STATE_ACTIVE)
> +				break;
> +		} while ((iclog = iclog->ic_next) != log->l_iclog);
> +	}
>  
>  	/*
>  	 * Wake up threads waiting in xfs_log_force() for the dirty iclog
> -- 
> 2.24.1
> 


  reply	other threads:[~2020-03-06 17:12 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-06 14:31 cleanup log I/O error handling Christoph Hellwig
2020-03-06 14:31 ` [PATCH 1/7] xfs: remove the unused return value from xfs_log_unmount_write Christoph Hellwig
2020-03-06 16:09   ` Brian Foster
2020-03-09  8:02     ` Christoph Hellwig
2020-03-10 22:28       ` Dave Chinner
2020-03-10 22:45         ` Darrick J. Wong
2020-03-11  5:59         ` Christoph Hellwig
2020-03-06 14:31 ` [PATCH 2/7] xfs: remove dead code " Christoph Hellwig
2020-03-06 16:10   ` Brian Foster
2020-03-06 14:31 ` [PATCH 3/7] xfs: cleanup xfs_log_unmount_write Christoph Hellwig
2020-03-06 16:12   ` Brian Foster
2020-03-06 14:31 ` [PATCH 4/7] xfs: remove the aborted parameter to xlog_state_done_syncing Christoph Hellwig
2020-03-06 17:12   ` Brian Foster
2020-03-09  8:03     ` Christoph Hellwig
2020-03-06 14:31 ` [PATCH 5/7] xfs: factor out a xlog_state_activate_iclog helper Christoph Hellwig
2020-03-06 17:12   ` Brian Foster
2020-03-09  8:03     ` Christoph Hellwig
2020-03-06 14:31 ` [PATCH 6/7] xfs: cleanup xlog_state_clean_iclog Christoph Hellwig
2020-03-06 17:12   ` Brian Foster [this message]
2020-03-06 14:31 ` [PATCH 7/7] xfs: kill XLOG_STATE_IOERROR Christoph Hellwig
2020-03-06 17:15   ` Brian Foster
2020-03-09  8:05     ` Christoph Hellwig

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=20200306171224.GI2773@bfoster \
    --to=bfoster@redhat.com \
    --cc=david@fromorbit.com \
    --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