[PATCH 22/24] xfs: swap inode reflink flags when swapping inode extents

Josef 'Jeff' Sipek jeffpc at josefsipek.net
Sat Aug 1 07:51:35 CDT 2015


On Wed, Jul 29, 2015 at 03:35:19PM -0700, Darrick J. Wong wrote:
> When we're swapping the extents of two inodes, be sure to swap the
> reflink inode flag too.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong at oracle.com>
> ---
>  fs/xfs/xfs_bmap_util.c |    5 +++++
>  1 file changed, 5 insertions(+)
> 
> 
> diff --git a/fs/xfs/xfs_bmap_util.c b/fs/xfs/xfs_bmap_util.c
> index 349a5a6..7bdec90 100644
> --- a/fs/xfs/xfs_bmap_util.c
> +++ b/fs/xfs/xfs_bmap_util.c
> @@ -1929,6 +1929,11 @@ xfs_swap_extents(
>  		break;
>  	}
>  
> +	if (xfs_is_reflink_inode(ip)) {
> +		tip->i_d.di_flags2 |= XFS_DIFLAG2_REFLINK;
> +		ip->i_d.di_flags2 &= ~XFS_DIFLAG2_REFLINK;

Are you guaranteed that the temp inode does not have the flag set to begin
with?  This doesn't swap, but rather moves over the flag one way, and clears
it the other way.

Jeff.

> +	}
> +
>  	xfs_trans_log_inode(tp, ip,  src_log_flags);
>  	xfs_trans_log_inode(tp, tip, target_log_flags);
>  
> 
> _______________________________________________
> xfs mailing list
> xfs at oss.sgi.com
> http://oss.sgi.com/mailman/listinfo/xfs

-- 
Si hoc legere scis nimium eruditionis habes.



More information about the xfs mailing list