public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 1/2] xfs: move shutdown out of xfs_trans_ail_delete_bulk
Date: Sat, 24 Mar 2012 13:01:46 -0400	[thread overview]
Message-ID: <20120324170146.GA21708@infradead.org> (raw)
In-Reply-To: <1332467263-12985-2-git-send-email-david@fromorbit.com>

>  	spin_lock(&ailp->xa_lock);
> -	xfs_trans_ail_delete(ailp, (xfs_log_item_t *)qfs);
> +	error = xfs_trans_ail_delete(ailp, (struct xfs_log_item *)qfs);

please make this a:

	error = xfs_trans_ail_delete(ailp, &qfs->qli_item);

while you're at it.

>  		if (lip->li_flags & XFS_LI_IN_AIL) {
>  			spin_lock(&ailp->xa_lock);
> -			if (lip->li_flags & XFS_LI_IN_AIL)
> -				xfs_trans_ail_delete(ailp, lip);
> -			else
> +			if (lip->li_flags & XFS_LI_IN_AIL) {
> +				int	error = xfs_trans_ail_delete(ailp, lip);
> +				if (error == EFSCORRUPTED)
> +					xfs_force_shutdown(ailp->xa_mount,
> +							SHUTDOWN_CORRUPT_INCORE);
> +			} else

Given that we already have two checks for XFS_LI_IN_AIL around the
call to xfs_trans_ail_delete I don't think we need to handle the error
here.

> @@ -887,8 +892,13 @@ xfs_iflush_abort(
>  		if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
>  			spin_lock(&ailp->xa_lock);
>  			if (iip->ili_item.li_flags & XFS_LI_IN_AIL) {
> +				int	error;
>  				/* xfs_trans_ail_delete() drops the AIL lock. */
> -				xfs_trans_ail_delete(ailp, (xfs_log_item_t *)iip);
> +				error = xfs_trans_ail_delete(ailp,
> +							(xfs_log_item_t *)iip);
> +				if (error == EFSCORRUPTED)
> +					xfs_force_shutdown(ailp->xa_mount,
> +							SHUTDOWN_CORRUPT_INCORE);

Same argument here.

Also please pass in &iip->>ili_item instead of the cast here.

_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs

  reply	other threads:[~2012-03-24 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-23  1:47 [PATCH 0/2] xfs: fix a class of shutdown hangs Dave Chinner
2012-03-23  1:47 ` [PATCH 1/2] xfs: move shutdown out of xfs_trans_ail_delete_bulk Dave Chinner
2012-03-24 17:01   ` Christoph Hellwig [this message]
2012-03-23  1:47 ` [PATCH 2/2] xfs: avoid shutdown hang in xlog_wait() Dave Chinner
2012-03-24 17:03   ` Christoph Hellwig
2012-03-24 22:46     ` Dave Chinner
2012-03-25 11:28       ` Christoph Hellwig
2012-03-27  9:45         ` [PATCH v2] shutdown hang fix (was Re: [PATCH 2/2] xfs: avoid shutdown hang in xlog_wait()) Dave Chinner
2012-03-27  9:57           ` Christoph Hellwig
2012-04-06 17:42           ` Mark Tinguely

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=20120324170146.GA21708@infradead.org \
    --to=hch@infradead.org \
    --cc=david@fromorbit.com \
    --cc=xfs@oss.sgi.com \
    /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