All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs: cancel intents immediately if process_intents fails
Date: Tue, 20 Oct 2020 06:38:44 -0400	[thread overview]
Message-ID: <20201020103844.GC1263949@bfoster> (raw)
In-Reply-To: <20201019162917.GJ9832@magnolia>

On Mon, Oct 19, 2020 at 09:29:17AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If processing recovered log intent items fails, we need to cancel all
> the unprocessed recovered items immediately so that a subsequent AIL
> push in the bail out path won't get wedged on the pinned intent items
> that didn't get processed.
> 
> This can happen if the log contains (1) an intent that gets and releases
> an inode, (2) an intent that cannot be recovered successfully, and (3)
> some third intent item.  When recovery of (2) fails, we leave (3) pinned
> in memory.  Inode reclamation is called in the error-out path of
> xfs_mountfs before xfs_log_cancel_mount.  Reclamation calls
> xfs_ail_push_all_sync, which gets stuck waiting for (3).
> 
> Therefore, call xlog_recover_cancel_intents if _process_intents fails.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

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

>  fs/xfs/xfs_log_recover.c |    8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
> index a8289adc1b29..87886b7f77da 100644
> --- a/fs/xfs/xfs_log_recover.c
> +++ b/fs/xfs/xfs_log_recover.c
> @@ -3446,6 +3446,14 @@ xlog_recover_finish(
>  		int	error;
>  		error = xlog_recover_process_intents(log);
>  		if (error) {
> +			/*
> +			 * Cancel all the unprocessed intent items now so that
> +			 * we don't leave them pinned in the AIL.  This can
> +			 * cause the AIL to livelock on the pinned item if
> +			 * anyone tries to push the AIL (inode reclaim does
> +			 * this) before we get around to xfs_log_mount_cancel.
> +			 */
> +			xlog_recover_cancel_intents(log);
>  			xfs_alert(log->l_mp, "Failed to recover intents");
>  			return error;
>  		}
> 


      reply	other threads:[~2020-10-20 10:38 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-19 16:29 [PATCH] xfs: cancel intents immediately if process_intents fails Darrick J. Wong
2020-10-20 10:38 ` Brian Foster [this message]

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=20201020103844.GC1263949@bfoster \
    --to=bfoster@redhat.com \
    --cc=darrick.wong@oracle.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.