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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 795C3EB64DA for ; Wed, 28 Jun 2023 08:27:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234199AbjF1I1z (ORCPT ); Wed, 28 Jun 2023 04:27:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234193AbjF1IZu (ORCPT ); Wed, 28 Jun 2023 04:25:50 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83A3B420E for ; Wed, 28 Jun 2023 01:15:36 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id d9443c01a7336-1b8033987baso4881665ad.0 for ; Wed, 28 Jun 2023 01:15:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1687940136; x=1690532136; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PvEuhE7V/s2leNt36xMTkTseKzYK2M8Qy+lofTFX35w=; b=oUK24B2A8Za5WrrazM1S/hRxwFkp9BjOmHqST8CZRgRZB3fRcOUafhKzNZJvruuPFG 7xCOOR92lTz2TnNk/7CTzDrWmi+VdtsBCOORsRJ0bONLTPYDNeyQzxfoGVt3PNkla1+e Y8rCCTnXp8I/X8yqf7004diDn+hVkoCB0+FWeKa3gaJ+7dGf+fwKgkOYxnLxKqeNuLSF Ap/0PgC80TefnDQ4rWEo7IvDW42FCASsBkYpbiMj8zIYzEGPDUxofylxKqJkD6DM9zFx pRr9IzzhrA0YYufhFDmZEVtALVIgI2fVt+/50UBjviVGsXj76m+yW0y7LAIS6Hc9CJ79 gVKQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687940136; x=1690532136; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PvEuhE7V/s2leNt36xMTkTseKzYK2M8Qy+lofTFX35w=; b=PuoKHAlJ4R7sW1chYKoIip1VWpxzXOWYV3v/yQJZiHfH5+cS0XeyWxKIK9llyDhtcZ VFhfhYWAH8HVapsQx6/1l9ESQFopNNDDv/5GhBFTLFnFUzHKq/6ABpeGVYO52dN/dYw3 2bZQCvouubqF5HX30uMBThsyundfwaOt9CTGcNC7XThH82r+Pbx1Gjep483TLDgtZZwV FX8IqSB/JdCv7W2DsfpEWdNAEvkklBW3BMzCrMl10ehKzJ2gFlVwJGMuOIIifffWksEv Ic1uhzk0Y9WBgNYgd8gl8BMJ35WYNnp3rQdNYek0kk644sIIyab2kyLGKEOFsEuCCD/2 j6Og== X-Gm-Message-State: AC+VfDx7eop2KVb6Fl+vkqn6JW+vTpKh3hw5VV1cS/zqkPaViw7IoPRW uVoWWAdW5aYbN/poaj9AxvU0pQ== X-Google-Smtp-Source: ACHHUZ5Y9FFEdf/ewaJbRjkYhd/dEAfNkLm0Ytbay14Tn3/dYZKh7+9KYeMo/EErTxGUf4ZTtlOgiA== X-Received: by 2002:a17:903:22c3:b0:1b6:783d:9ba7 with SMTP id y3-20020a17090322c300b001b6783d9ba7mr866965plg.27.1687940135978; Wed, 28 Jun 2023 01:15:35 -0700 (PDT) Received: from dread.disaster.area (pa49-186-94-37.pa.vic.optusnet.com.au. [49.186.94.37]) by smtp.gmail.com with ESMTPSA id i9-20020a17090332c900b00192aa53a7d5sm7191824plr.8.2023.06.28.01.15.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 01:15:35 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.96) (envelope-from ) id 1qEQKq-00H9cE-1z; Wed, 28 Jun 2023 18:15:32 +1000 Date: Wed, 28 Jun 2023 18:15:32 +1000 From: Dave Chinner To: David Howells Cc: Matthew Wilcox , Matt Whitlock , linux-fsdevel@vger.kernel.org, Christoph Hellwig , Jens Axboe , Al Viro Subject: Re: [Reproducer] Corruption, possible race between splice and FALLOC_FL_PUNCH_HOLE Message-ID: References: <3299543.1687933850@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3299543.1687933850@warthog.procyon.org.uk> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@vger.kernel.org On Wed, Jun 28, 2023 at 07:30:50AM +0100, David Howells wrote: > Matthew Wilcox wrote: > > > > > Expected behavior: > > > > Punching holes in a file after splicing pages out of that file into a pipe > > > > should not corrupt the spliced-out pages in the pipe buffer. > > I think this bit is the key. Why would this be the expected behaviour? As > you say, splice is allowed to stuff parts of the pagecache into a pipe and > these may get transferred, say, to a network card at the end to transmit > directly from. It's a form of direct I/O. If someone has the pages mmapped, > they can change the data that will be transmitted; if someone does a write(), > they can change that data too. The point of splice is to avoid the copy - but > it comes with a tradeoff. I wouldn't call "post-splice filesystem modifications randomly corrupts pipe data" a tradeoff. I call that a bug. -Dave. -- Dave Chinner david@fromorbit.com