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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 519FBEB64D9 for ; Thu, 29 Jun 2023 18:06:39 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B16838D0002; Thu, 29 Jun 2023 14:06:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id AC71F8D0001; Thu, 29 Jun 2023 14:06:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 98ECD8D0002; Thu, 29 Jun 2023 14:06:38 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 89CCF8D0001 for ; Thu, 29 Jun 2023 14:06:38 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 59B43160AB2 for ; Thu, 29 Jun 2023 18:06:38 +0000 (UTC) X-FDA: 80956565676.23.181DB16 Received: from resqmta-h1p-028588.sys.comcast.net (resqmta-h1p-028588.sys.comcast.net [96.102.200.10]) by imf26.hostedemail.com (Postfix) with ESMTP id 5BF15140024 for ; Thu, 29 Jun 2023 18:06:28 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=comcastmailservice.net header.s=20211018a header.b=iZhmhLlG; dmarc=none; spf=pass (imf26.hostedemail.com: domain of kernel@mattwhitlock.name designates 96.102.200.10 as permitted sender) smtp.mailfrom=kernel@mattwhitlock.name ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1688061989; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=n3lCJnmHXgrKtY1GgvvLvqdYKQaVBuxxsH4QSdYckhY=; b=aWg+S7XAITnOT/354dQvOEdKkUWyn5UfCUOZCCKsXWpWOZoGhewUxWZTFln9flWP/EUZPo 9UYHlD7j6mbtSbICk18BJ+Y5HW5q1RKT6ekmt8wXM2LnM0UVDkVLuUDP7W+Y+Z6KOlSZ+7 7V5gLpYn5RPt/YJ6orqXOpZp4ixnzkY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=comcastmailservice.net header.s=20211018a header.b=iZhmhLlG; dmarc=none; spf=pass (imf26.hostedemail.com: domain of kernel@mattwhitlock.name designates 96.102.200.10 as permitted sender) smtp.mailfrom=kernel@mattwhitlock.name ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1688061989; a=rsa-sha256; cv=none; b=2aVyNlMifQF/l1SGrU2gxAooPZZTNI+ggOXBH46SRLFsuHiMiE1O7/6f9JOQDarh0H88r9 +yeXBJ53cs4eIC3dhwHI5xbAQtNcqvgGJqclop63DVXG7FYBxNAQeFsWe0Z+953a9H2xnW P3rjl+2iUKKEqpqpIwN3REkku02A/pk= Received: from resomta-h1p-027911.sys.comcast.net ([96.102.179.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 256/256 bits) (Client did not present a certificate) by resqmta-h1p-028588.sys.comcast.net with ESMTP id EvDIql4HPqqnBEw1IqxCGc; Thu, 29 Jun 2023 18:05:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcastmailservice.net; s=20211018a; t=1688061928; bh=n3lCJnmHXgrKtY1GgvvLvqdYKQaVBuxxsH4QSdYckhY=; h=Received:Received:From:To:Subject:Date:MIME-Version:Message-ID: Content-Type:Xfinity-Spam-Result; b=iZhmhLlGmxJZy0jkMNy9fyaJrlkCSo2vy3tF5thkgTP5jw2Bz+cv2/eX170Agp2gD idl81rnvmEePitS7H5ZEJzdsz2/ooPDR/6xoNLXsEATs+T98jLbD2/B/sGV3oCK6rK uhj/mL2GeiEB5o57vZUqHu5LanEFjpAN1V8WYZmTFCwknw21IDpXmcRrhOYfX0w2BR VYpUR/zki64KoLqOXZ6/3dfOR6XUsthgrJ+EHiUXFngNi3i6Y+VPdC8ftVzHsAFtF6 y7Il7fJcLh2/JobD+0gtM7jkPS1fdys46wnMFUek5+AlI0JNBeKo4PwNBhydF1xau4 uRnvR5mNzUm2A== 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-h1p-027911.sys.comcast.net with ESMTPSA id Ew17qC5nh2DGmEw19qI2Ra; Thu, 29 Jun 2023 18:05:23 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit From: Matt Whitlock To: Linus Torvalds Cc: David Howells , , Matthew Wilcox , Dave Chinner , Jens Axboe , , , Subject: Re: [RFC PATCH 0/4] splice: Fix corruption in data spliced to pipe Date: Thu, 29 Jun 2023 14:05:16 -0400 MIME-Version: 1.0 Message-ID: <4bd92932-c9d2-4cc8-b730-24c749087e39@mattwhitlock.name> In-Reply-To: References: <20230629155433.4170837-1-dhowells@redhat.com> 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-Rspam-User: X-Stat-Signature: uejgsiz99mipo885op7tfudoxgwtqfem X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 5BF15140024 X-HE-Tag: 1688061988-803292 X-HE-Meta: U2FsdGVkX191uxACTwt2YDcEG5gLR18QBv/2kRly6hLN20ITxlHrMwcZ/ozZQk8uXDdJG9mM+RerbSQ0KuZJoISw0crjHM1HAhXeYD5H+NhvdGcR1g1u5Io8NVC7U+i8xIAvXj3agUG0FElfV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IyZANZViFFwxHGQkA4O612RNEZqMKw3Xi/URxJorhiXyG3kquQ+39CMlsGkcdiZfmrw8wd0bKX7qvdgjAtPhc7Usp+MdO5RGBKzgS0O9/UH+7ge69CaudIVH9VRW5dw9FDYXbCp/DK5w== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thursday, 29 June 2023 13:56:04 EDT, Linus Torvalds wrote: > On Thu, 29 Jun 2023 at 08:55, David Howells wrote: >>=20 >> Matt Whitlock, Matthew Wilcox and Dave Chinner are of the=20 >> opinion that data >> in the pipe must not be seen to change and that if it does, this is a bug.= > > I'm not convinced. > > The whole *point* of vmsplice (and splicing from a file) is the zero-copy. > > If you don't want the zero-copy, then you should use just "write()". If you want zero copies, then call splice() *with* SPLICE_F_MOVE. If you want one copy (kernel-to-kernel), then call splice() *without*=20 SPLICE_F_MOVE. If you want two copies (kernel-to-user + user-to-kernel), call read() and=20 write(). I don't know why SPLICE_F_MOVE is being ignored in this thread. Sure, maybe=20= the way it has historically been implemented was only relevant when the=20 input FD is a pipe, but that's not what the man page implies. You have the=20= opportunity to make it actually do what it says on the tin.