Received: by 2002:a05:6358:7058:b0:131:369:b2a3 with SMTP id 24csp8874175rwp; Wed, 19 Jul 2023 17:18:25 -0700 (PDT) X-Google-Smtp-Source: APBJJlEz7d8rhDqa2vcGfriEEaesGllrXQrtDvfEpm+0j3Zs6XVWI1E7SjUHVWBHZqt3Mn+SQ0/L X-Received: by 2002:a17:906:100b:b0:994:3395:942f with SMTP id 11-20020a170906100b00b009943395942fmr3617984ejm.17.1689812305444; Wed, 19 Jul 2023 17:18:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1689812305; cv=none; d=google.com; s=arc-20160816; b=Qb7+JHjamHN+izCa/4zHSr7OfaJp+S6z4lLUG1usogXAAFQXKquboZn2KJzcMlAsou 4qbfW5pxkPlpllrrOml+TGm1ATFR1XqyniWQne94Nk1HLloFbSK8iA7s8chYeSI4sYDH piIYtISZbVIwhKxnrRcz8803zNj5VEJXgKZgaSQdHBmb9hKbshwPmS6iP1ldFqbiYEXR dxjjFPn15iB3hFrIy3Swb7CMIgzkdrSbePKZlsV0d7/24nN4gKgjr7j+xLMHR66lLtth YLLD3pHRwcjaIedgY2PQsQhR/I68AJonxkAfhQKFAVzOyqPkuZITFNGh9q/Oa6XsNXxL Ogaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:user-agent:references :in-reply-to:message-id:mime-version:date:subject:cc:to:from :dkim-signature; bh=D0Zxwoc5PyVtQd58yNNXz/EasT5elbjv8i+Mv7KlxLk=; fh=hgTmwki9jvKjY9VYHHdnXjuMu4lM/Rw8ycKJ0jUwya4=; b=LeaVPXOoVBjXoOajqJYqBNa/1v89c9ZgrwoCGH84EXw1YvCd8EidmpG7sV4+aR9++b 0xwuIKWDJw3ZP0o/vdSK4jHAqegA5cXZSeI5i7/CFc/JEZolyUdBen1vl4fBPs9rfkEE JbLQv95MD8Ccpmu+KS4gs2jZjoSyA20fB2dPA+1ibC+pJ0LogpQ5P9pkzW7/VuOvWtyp yP9sAQK6Qk3kW8R+TKkINWH+cfSk8gqGHcx6P0g+27OL1ANY49yP5Y6+CtgGrU/hdTyL 66HeGHHFV4TleBIVDcG886D6tR4Cczp6KwhkPVyLffBFv+Plm9ph1xjEFgv0mw0ULkQ4 ziFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@comcastmailservice.net header.s=20211018a header.b=sqlsKlOv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h5-20020a170906718500b00986560ae9a7si3952678ejk.307.2023.07.19.17.18.01; Wed, 19 Jul 2023 17:18:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@comcastmailservice.net header.s=20211018a header.b=sqlsKlOv; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229815AbjGSXlU (ORCPT + 99 others); Wed, 19 Jul 2023 19:41:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41590 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229703AbjGSXlT (ORCPT ); Wed, 19 Jul 2023 19:41:19 -0400 Received: from resdmta-c1p-023854.sys.comcast.net (resdmta-c1p-023854.sys.comcast.net [IPv6:2001:558:fd00:56::d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63E64E69 for ; Wed, 19 Jul 2023 16:41:18 -0700 (PDT) Received: from resomta-c1p-023269.sys.comcast.net ([96.102.18.227]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resdmta-c1p-023854.sys.comcast.net with ESMTP id MC9Tq2iz25fwRMGnFqnXWh; Wed, 19 Jul 2023 23:41:17 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20211018a; t=1689810077; bh=D0Zxwoc5PyVtQd58yNNXz/EasT5elbjv8i+Mv7KlxLk=; h=Received:Received:From:To:Subject:Date:MIME-Version:Message-ID: Content-Type:Xfinity-Spam-Result; b=sqlsKlOvFSI4lxRTXrNSR4seZGf5iLSDawGPqWpxYvdXJAMurkohE8bsrfp1hE/5i 7JdZr2tjIZxEPARFRl69kmmCoCaY8mgOencq9mMmzGuBfHq1uqemzmpc7tz9isIJMS fF1c8Kc6ChTLVOPRwtMowI7KrrKMicONqGOzADLVFAfZpGXTs7X6Qk/J87nB4K1aTs FLrUBByWH8+WN8tN+OZjq79aNRW5uaUch/iag6P/Yf79juA8tAp+gxowRjaqzF0w1s IFC5hYe3o7VlqOyKxrenrK+9t9ZS20P5Fvn5mcKOqQaqxxLC8ncDkHNO4shLbIigJd UJzcFWSOez5uw== Received: from localhost ([IPv6:2601:18c:9082:afd:219:d1ff:fe75:dc2f]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resomta-c1p-023269.sys.comcast.net with ESMTPSA id MGn6q5Mwsf3EjMGn7qAANV; Wed, 19 Jul 2023 23:41:13 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit From: Matt Whitlock To: Linus Torvalds Cc: Matthew Wilcox , Miklos Szeredi , David Howells , , Dave Chinner , Jens Axboe , , , , Christoph Hellwig , Subject: Re: [RFC PATCH 1/4] splice: Fix corruption of spliced data after =?iso-8859-1?Q?splice()_returns?= Date: Wed, 19 Jul 2023 19:41:07 -0400 MIME-Version: 1.0 Message-ID: <0d10033a-7ea1-48e3-806b-f74000045915@mattwhitlock.name> In-Reply-To: References: <20230629155433.4170837-1-dhowells@redhat.com> <20230629155433.4170837-2-dhowells@redhat.com> <6609f1b8-3264-4017-ac3c-84a01ea12690@mattwhitlock.name> User-Agent: Trojita/v0.7-595-g7738cd47; Qt/5.15.10; xcb; Linux; Gentoo Linux Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MIME_QP_LONG_LINE,RCVD_IN_DNSWL_BLOCKED,SPF_HELO_PASS, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday, 19 July 2023 19:20:32 EDT, Linus Torvalds wrote: >> On Wednesday, 19 July 2023 16:16:07 EDT, Linus Torvalds wrote: >>> The *ONLY* reason for splice() existing is for zero-copy. >>=20 >> The very first sentence of splice(2) reads: "splice() moves data between >> two file descriptors without copying between kernel address space and user= >> address space." Thus, it is not unreasonable to believe that the point of >> splice is to avoid copying between user-space and kernel-space. > > I'm not at all opposed to clarifying the documentation. Then that is my request. This entire complaint/discussion/argument would=20 have been avoided if splice(2) had contained a sentence like this one from=20= sendfile(2): "If out_fd refers to a socket or pipe with zero-copy support, callers must=20= ensure the transferred portions of the file referred to by in_fd remain=20 unmodified until the reader on the other end of out_fd has consumed the=20 transferred data." That is a clear warning of the perils of the implementation under the hood,=20= and it could/should be copied, more or less verbatim, to splice(2).