xfs
[Top] [All Lists]

Re: [PATCH 2/5] xfs: skip stale inodes in xfs_iflush_cluster

To: Dave Chinner <david@xxxxxxxxxxxxx>
Subject: Re: [PATCH 2/5] xfs: skip stale inodes in xfs_iflush_cluster
From: Brian Foster <bfoster@xxxxxxxxxx>
Date: Wed, 6 Apr 2016 08:51:50 -0400
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <1459934574-25543-3-git-send-email-david@xxxxxxxxxxxxx>
References: <1459934574-25543-1-git-send-email-david@xxxxxxxxxxxxx> <1459934574-25543-3-git-send-email-david@xxxxxxxxxxxxx>
User-agent: Mutt/1.5.24 (2015-08-30)
On Wed, Apr 06, 2016 at 07:22:51PM +1000, Dave Chinner wrote:
> From: Dave Chinner <dchinner@xxxxxxxxxx>
> 
> We don't write back stale inodes, so we should skip them in
> xfS_iflush_cluster, too.

  xfs_iflush_cluster

> 
> Signed-off-by: Dave Chinner <dchinner@xxxxxxxxxx>
> ---

Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx>

>  fs/xfs/xfs_inode.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/fs/xfs/xfs_inode.c b/fs/xfs/xfs_inode.c
> index 2718d10..6598104 100644
> --- a/fs/xfs/xfs_inode.c
> +++ b/fs/xfs/xfs_inode.c
> @@ -3190,10 +3190,11 @@ xfs_iflush_cluster(
>                * because this is an RCU protected lookup, we could find a
>                * recently freed or even reallocated inode during the lookup.
>                * We need to check under the i_flags_lock for a valid inode
> -              * here. Skip it if it is not valid or the wrong inode.
> +              * here. Skip it if it is not valid, stale or the wrong inode.
>                */
>               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) {
>                       spin_unlock(&cip->i_flags_lock);
>                       continue;
> -- 
> 2.7.0
> 
> _______________________________________________
> xfs mailing list
> xfs@xxxxxxxxxxx
> http://oss.sgi.com/mailman/listinfo/xfs

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