Re: [PATCH 4/6] xfs: relax is_reflink_inode assert in xfs_reflink_find_cow_mapping

Christoph Hellwig
2017-12-14T16:38:55Z

On Sun, Dec 10, 2017 at 06:16:41PM -0800, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
>
> We don't hold the ilock through the entire sequence of xfs_writepage_map
> -> xfs_map_cow -> xfs_reflink_find_cow_mapping. This means that we can
> race with another thread that is trying to clear the inode reflink flag,
> with the result that the flag is set for the xfs_map_cow check but
> cleared before we get to the assert in find_cow_mapping. When this
> happens, we blow the assert even though everything is fine.
>
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Looks good,

Reviewed-by: Christoph Hellwig <hch@lst.de>