From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 89EEBC2D0E2 for ; Thu, 24 Sep 2020 04:03:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5B38623899 for ; Thu, 24 Sep 2020 04:03:31 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726714AbgIXEDa (ORCPT ); Thu, 24 Sep 2020 00:03:30 -0400 Received: from verein.lst.de ([213.95.11.211]:50684 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726477AbgIXEDa (ORCPT ); Thu, 24 Sep 2020 00:03:30 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B9BFD68AFE; Thu, 24 Sep 2020 06:03:27 +0200 (CEST) Date: Thu, 24 Sep 2020 06:03:27 +0200 From: Christoph Hellwig To: Eric Sandeen Cc: xfs , stable@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH STABLE] xfs: trim IO to found COW exent limit Message-ID: <20200924040327.GA8078@lst.de> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org 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: # 5.4.x > Signed-off-by: Eric Sandeen Looks good, Reviewed-by: Christoph Hellwig and as Darrick said we'll want to wire up the reproducer for xfstests.