diff mbox

[1/8] xfs: fix the check for COW extents in xfs_swap_extents

Message ID 20180313143601.30028-2-hch@lst.de (mailing list archive)
State Accepted
Headers show

Commit Message

Christoph Hellwig March 13, 2018, 2:35 p.m. UTC
i_cnextents does not include delayed allocated extents, so switch
to the inode fork size check that we already use in other places
instead.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 fs/xfs/xfs_bmap_util.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Darrick J. Wong March 13, 2018, 8:42 p.m. UTC | #1
On Tue, Mar 13, 2018 at 03:35:54PM +0100, Christoph Hellwig wrote:
> i_cnextents does not include delayed allocated extents, so switch
> to the inode fork size check that we already use in other places
> instead.
> 
> Signed-off-by: Christoph Hellwig <hch@lst.de>

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

--D

> ---
>  fs/xfs/xfs_bmap_util.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index e0a442f504e5..19ea7d086cf8 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -2014,11 +2014,11 @@ xfs_swap_extents(
>  		ip->i_cowfp = tip->i_cowfp;
>  		tip->i_cowfp = cowfp;
>  
> -		if (ip->i_cowfp && ip->i_cnextents)
> +		if (ip->i_cowfp && ip->i_cowfp->if_bytes)
>  			xfs_inode_set_cowblocks_tag(ip);
>  		else
>  			xfs_inode_clear_cowblocks_tag(ip);
> -		if (tip->i_cowfp && tip->i_cnextents)
> +		if (tip->i_cowfp && tip->i_cowfp->if_bytes)
>  			xfs_inode_set_cowblocks_tag(tip);
>  		else
>  			xfs_inode_clear_cowblocks_tag(tip);
> -- 
> 2.14.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
index e0a442f504e5..19ea7d086cf8 100644
--- a/fs/xfs/xfs_bmap_util.c
+++ b/fs/xfs/xfs_bmap_util.c
@@ -2014,11 +2014,11 @@  xfs_swap_extents(
 		ip->i_cowfp = tip->i_cowfp;
 		tip->i_cowfp = cowfp;
 
-		if (ip->i_cowfp && ip->i_cnextents)
+		if (ip->i_cowfp && ip->i_cowfp->if_bytes)
 			xfs_inode_set_cowblocks_tag(ip);
 		else
 			xfs_inode_clear_cowblocks_tag(ip);
-		if (tip->i_cowfp && tip->i_cnextents)
+		if (tip->i_cowfp && tip->i_cowfp->if_bytes)
 			xfs_inode_set_cowblocks_tag(tip);
 		else
 			xfs_inode_clear_cowblocks_tag(tip);