Re: [PATCH 12/24] xfs: pin inode backing buffer to the inode log item

Christoph Hellwig
2020-05-23T09:34:54Z

> --- a/fs/xfs/xfs_trans_priv.h
> +++ b/fs/xfs/xfs_trans_priv.h
> @@ -143,15 +143,10 @@ static inline void
> xfs_clear_li_failed(
> struct xfs_log_item *lip)
> {
> - struct xfs_buf *bp = lip->li_buf;
> -
> ASSERT(test_bit(XFS_LI_IN_AIL, &lip->li_flags));
> lockdep_assert_held(&lip->li_ailp->ail_lock);
>
> - if (test_and_clear_bit(XFS_LI_FAILED, &lip->li_flags)) {
> - lip->li_buf = NULL;
> - xfs_buf_rele(bp);
> - }
> + clear_bit(XFS_LI_FAILED, &lip->li_flags);
> }
>
> static inline void
> @@ -161,10 +156,7 @@ xfs_set_li_failed(
> {
> lockdep_assert_held(&lip->li_ailp->ail_lock);
>
> - if (!test_and_set_bit(XFS_LI_FAILED, &lip->li_flags)) {
> - xfs_buf_hold(bp);
> - lip->li_buf = bp;
> - }
> + set_bit(XFS_LI_FAILED, &lip->li_flags);
> }

Isn't this going to break quotas, which don't always have li_buf set?