diff mbox series

[2/2] xfs: return locked status of inode buffer on xfsaild push

Message ID 20200326131703.23246-3-bfoster@redhat.com (mailing list archive)
State Accepted
Headers show
Series xfs: a couple AIL pushing trylock fixes | expand

Commit Message

Brian Foster March 26, 2020, 1:17 p.m. UTC
If the inode buffer backing a particular inode is locked,
xfs_iflush() returns -EAGAIN and xfs_inode_item_push() skips the
inode. It still returns success to xfsaild, however, which bypasses
the xfsaild backoff heuristic. Update xfs_inode_item_push() to
return locked status if the inode buffer couldn't be locked.

Signed-off-by: Brian Foster <bfoster@redhat.com>
---
 fs/xfs/xfs_inode_item.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Christoph Hellwig March 27, 2020, 1 p.m. UTC | #1
On Thu, Mar 26, 2020 at 09:17:03AM -0400, Brian Foster wrote:
> If the inode buffer backing a particular inode is locked,
> xfs_iflush() returns -EAGAIN and xfs_inode_item_push() skips the
> inode. It still returns success to xfsaild, however, which bypasses
> the xfsaild backoff heuristic. Update xfs_inode_item_push() to
> return locked status if the inode buffer couldn't be locked.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>
Darrick J. Wong March 27, 2020, 3:39 p.m. UTC | #2
On Thu, Mar 26, 2020 at 09:17:03AM -0400, Brian Foster wrote:
> If the inode buffer backing a particular inode is locked,
> xfs_iflush() returns -EAGAIN and xfs_inode_item_push() skips the
> inode. It still returns success to xfsaild, however, which bypasses
> the xfsaild backoff heuristic. Update xfs_inode_item_push() to
> return locked status if the inode buffer couldn't be locked.
> 
> Signed-off-by: Brian Foster <bfoster@redhat.com>

Seems pretty straightforward,

Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

--D

> ---
>  fs/xfs/xfs_inode_item.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
> index 4a3d13d4a022..9a903babbcf7 100644
> --- a/fs/xfs/xfs_inode_item.c
> +++ b/fs/xfs/xfs_inode_item.c
> @@ -552,7 +552,8 @@ xfs_inode_item_push(
>  		if (!xfs_buf_delwri_queue(bp, buffer_list))
>  			rval = XFS_ITEM_FLUSHING;
>  		xfs_buf_relse(bp);
> -	}
> +	} else if (error == -EAGAIN)
> +		rval = XFS_ITEM_LOCKED;
>  
>  	spin_lock(&lip->li_ailp->ail_lock);
>  out_unlock:
> -- 
> 2.21.1
>
diff mbox series

Patch

diff --git a/fs/xfs/xfs_inode_item.c b/fs/xfs/xfs_inode_item.c
index 4a3d13d4a022..9a903babbcf7 100644
--- a/fs/xfs/xfs_inode_item.c
+++ b/fs/xfs/xfs_inode_item.c
@@ -552,7 +552,8 @@  xfs_inode_item_push(
 		if (!xfs_buf_delwri_queue(bp, buffer_list))
 			rval = XFS_ITEM_FLUSHING;
 		xfs_buf_relse(bp);
-	}
+	} else if (error == -EAGAIN)
+		rval = XFS_ITEM_LOCKED;
 
 	spin_lock(&lip->li_ailp->ail_lock);
 out_unlock: