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 A11C7C05027 for ; Fri, 10 Feb 2023 22:26:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233394AbjBJW0B (ORCPT ); Fri, 10 Feb 2023 17:26:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54954 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232840AbjBJW0A (ORCPT ); Fri, 10 Feb 2023 17:26:00 -0500 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CE497534C for ; Fri, 10 Feb 2023 14:25:59 -0800 (PST) Received: by mail-pj1-x102b.google.com with SMTP id a8-20020a17090a6d8800b002336b48f653so5466549pjk.3 for ; Fri, 10 Feb 2023 14:25:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; t=1676067959; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=VXBM3BZPJurQG+9S0/yF7Jxgoc2wkik3nPAHNKQyPdo=; b=2dnOYsDrWpY6Q9SO7Yz27hs41FZUdKTa840dThiS0JCvA81scgVYZGfZ588HEWjYJx h50yZMB+2DNsfYenYGLA1BoQrIq3iKsZFh31wBsZ5F2/3MME40Gcts0oruqC2rGXzkrp rjIESvq4+M6VD3SUkw4Kcm6JnGB/UAL1beCa+y3qZwfPER8cMI9xkiCda3pgOrnpp6AT GjxH6mrdBt4uQwqLmfBOLLXUPmednsBvlBZ5vVeai/L8z37NFSypqnq5UuxeGBUIVUeO vqvR7J4CvAIjb7n0WoVWir2d7Ykj3YMne8ASZm70XCVCRz2i4AtmhU3qoGpYDdp68KgI PC/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1676067959; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=VXBM3BZPJurQG+9S0/yF7Jxgoc2wkik3nPAHNKQyPdo=; b=JqBOL0WNTpXq2GTfrwGaxyC+4No4AR+iwZ0JPbbCh16Nd0JKSTAD7tpeCvdORveUtS 3lMEMs8pCxRCf7rGKZ7KF+4U1yowrZZ4rlldDBERUS3A8CP1helhQWC3AsBXsswWvc+3 TrSSU19Ayg3tWnV3i50AEXnHMDhFNzqSHHsWZUg5hvKcYh+m5t+XrFMymUJjMi1dBWCR jEawpEWJavxnNK3d++bepM2s7M55Hi3ac6K4c2eTgF3fnZNhbuebPwBtIQZlRO1FPRwm Q1nDPeHoAgOd3MY3j6Urlc7WrLhkcTAALtU+X1b/2z41BiqAv8raelFgi28ULuia17wL A/Yw== X-Gm-Message-State: AO0yUKV8FwJPfNtkXtr1u2BSYN6uIkVZZCYNyOPKpSwLXDuutuEgZn7/ 3m8t8kYOlP6Eez+7xaEmWLyptg== X-Google-Smtp-Source: AK7set+GrkUIVowp8cBbgQHdtPTA9kJYbebkONcykH0FZvMiCq2V47NSvr+b8gJtPFWlvvKx7UygHQ== X-Received: by 2002:a17:903:182:b0:199:1292:53cd with SMTP id z2-20020a170903018200b00199129253cdmr17899305plg.1.1676067958914; Fri, 10 Feb 2023 14:25:58 -0800 (PST) Received: from [192.168.1.136] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id jb1-20020a170903258100b001990c6c16ebsm3856968plb.37.2023.02.10.14.25.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 14:25:58 -0800 (PST) Message-ID: <824fa356-7d6e-6733-8848-ab84d850c27a@kernel.dk> Date: Fri, 10 Feb 2023 15:25:56 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: copy on write for splice() from file to pipe? Content-Language: en-US To: Linus Torvalds , Ming Lei Cc: Andy Lutomirski , Dave Chinner , Matthew Wilcox , Stefan Metzmacher , linux-fsdevel , Linux API Mailing List , io-uring , "linux-kernel@vger.kernel.org" , Al Viro , Samba Technical References: <0cfd9f02-dea7-90e2-e932-c8129b6013c7@samba.org> <1dd85095-c18c-ed3e-38b7-02f4d13d9bd6@kernel.dk> <7a2e5b7f-c213-09ff-ef35-d6c2967b31a7@kernel.dk> <2bb12591-9d24-6b26-178f-05e939bf3251@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org On 2/10/23 3:17?PM, Linus Torvalds wrote: > On Fri, Feb 10, 2023 at 2:08 PM Linus Torvalds > wrote: >> >> (a) the first one is to protect from endless loops > > Just to clarify: they're not "endless loops" per se, but we have > splice sources and destinations that always succeed, like /dev/zero > and /dev/null. > > So things like "sendfile()" that are happy to just repeat until done > do need to have some kind of signal handling even for the case when > we're not actually waiting for data. That's what that whole > > /* > * Check for signal early to make process killable when there are > * always buffers available > */ > > this is all about. See commit c725bfce7968 ("vfs: Make sendfile(2) > killable even better") for a less obvious example than that > "zero->null" kind of thing. > > (I actually suspect that /dev/zero no longer works as a splice source, > since we disabled the whole "fall back to regular IO" that Christoph > did in 36e2c7421f02 "fs: don't allow splice read/write without > explicit ops"). Yet another one... Since it has a read_iter, should be fixable with just adding the generic splice_read. -- Jens Axboe