public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Brian Foster <bfoster@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: xfs@oss.sgi.com
Subject: Re: [PATCH 3/5] xfs: xfs_iflush_cluster has range issues
Date: Wed, 6 Apr 2016 08:52:02 -0400	[thread overview]
Message-ID: <20160406125201.GC4188@bfoster.bfoster> (raw)
In-Reply-To: <1459934574-25543-4-git-send-email-david@fromorbit.com>

On Wed, Apr 06, 2016 at 07:22:52PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@redhat.com>
> 
> 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@redhat.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  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@oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

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

  reply	other threads:[~2016-04-06 12:52 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-06  9:22 [PATCH 0/5] xfs; xfs_iflush_cluster vs xfs_reclaim_inode Dave Chinner
2016-04-06  9:22 ` [PATCH 1/5] xfs: fix inode validity check in xfs_iflush_cluster Dave Chinner
2016-04-06 12:51   ` Brian Foster
2016-04-07 15:47   ` Christoph Hellwig
2016-04-06  9:22 ` [PATCH 2/5] xfs: skip stale inodes " Dave Chinner
2016-04-06 12:51   ` Brian Foster
2016-04-07 15:47   ` Christoph Hellwig
2016-04-06  9:22 ` [PATCH 3/5] xfs: xfs_iflush_cluster has range issues Dave Chinner
2016-04-06 12:52   ` Brian Foster [this message]
2016-04-07 15:48   ` Christoph Hellwig
2016-04-06  9:22 ` [PATCH 4/5] xfs: xfs_inode_free() isn't RCU safe Dave Chinner
2016-04-07 15:50   ` Christoph Hellwig
2016-04-06  9:22 ` [PATCH 5/5] xfs: mark reclaimed inodes invalid earlier Dave Chinner
2016-04-06 12:52 ` [PATCH 0/5] xfs; xfs_iflush_cluster vs xfs_reclaim_inode Brian Foster

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=20160406125201.GC4188@bfoster.bfoster \
    --to=bfoster@redhat.com \
    --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