xfs
[Top] [All Lists]

Re: [PATCH 3/5] xfs: xfs_iflush_cluster has range issues

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 3/5] xfs: xfs_iflush_cluster has range issues
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Wed, 6 Apr 2016 08:52:02 -0400
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1459934574-25543-4-git-send-email-david@xxxxxxxxxxxxx>
References: <1459934574-25543-1-git-send-email-david@xxxxxxxxxxxxx> <1459934574-25543-4-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.24 (2015-08-30)
On Wed, Apr 06, 2016 at 07:22:52PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> xfs_iflush_cluster() does a gang lookup on the radix tree, meaning
> it can find inode beyond the current cluster if there is sparse

              inodes

> cache population. gang lookups return results in ascending index
> order, so stop trying to cluster iodes once the first inode outside

                                   inodes

> the cluster mask is detected.
> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  fs/xfs/xfs_inode.c | 13 +++++++++++--
>  1 file changed, 11 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 6598104..b984be4 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3194,11 +3194,20 @@ xfs_iflush_cluster(
>                */
>               spin_lock(&cip->i_flags_lock);
>               if (!cip->i_ino ||
> -                 __xfs_iflags_test(ip, XFS_ISTALE) ||
> -                 (XFS_INO_TO_AGINO(mp, cip->i_ino) & mask) != first_index) {
> +                 __xfs_iflags_test(ip, XFS_ISTALE)) {
>                       spin_unlock(&cip->i_flags_lock);
>                       continue;
>               }
> +
> +             /*
> +              * Once we fall off the end of the cluster, no point checking
> +              * any more inodes in the list because they will also all be
> +              * outside the cluster.
> +              */
> +             if ((XFS_INO_TO_AGINO(mp, cip->i_ino) & mask) != first_index) {
> +                     spin_unlock(&cip->i_flags_lock);
> +                     break;
> +             }
>               spin_unlock(&cip->i_flags_lock);
>  
>               /*
> -- 
> 2.7.0
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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