xfs
[Top] [All Lists]

Re: [PATCH 1/2] xfs: move shutdown out of xfs_trans_ail_delete_bulk

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 1/2] xfs: move shutdown out of xfs_trans_ail_delete_bulk
From: Christoph Hellwig <hch@xxxxxxxxxxxxx>
Date: Sat, 24 Mar 2012 13:01:46 -0400
Cc: xfs@xxxxxxxxxxx
In-reply-to: <1332467263-12985-2-git-send-email-david@xxxxxxxxxxxxx>
References: <1332467263-12985-1-git-send-email-david@xxxxxxxxxxxxx> <1332467263-12985-2-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
>       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.

<Prev in Thread] Current Thread [Next in Thread>