Re: [PATCH STABLE] xfs: trim IO to found COW exent limit

Christoph Hellwig
2020-09-24T04:03:31Z

On Wed, Sep 23, 2020 at 05:35:44PM -0500, Eric Sandeen wrote:
> A bug existed in the XFS reflink code between v5.1 and v5.5 in which
> the mapping for a COW IO was not trimmed to the mapping of the COW
> extent that was found. This resulted in a too-short copy, and
> corruption of other files which shared the original extent.
>
> (This happened only when extent size hints were set, which bypasses
> delalloc and led to this code path.)
>
> This was (inadvertently) fixed upstream with
>
> 36adcbace24e "xfs: fill out the srcmap in iomap_begin"
>
> and related patches which moved lots of this functionality to
> the iomap subsystem.
>
> Hence, this is a -stable only patch, targeted to fix this
> corruption vector without other major code changes.
>
> Fixes: 78f0cc9d55cb ("xfs: don't use delalloc extents for COW on files with extsize hints")
> Cc: <stable@vger.kernel.org> # 5.4.x
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks good,

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

and as Darrick said we'll want to wire up the reproducer for xfstests.