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 5E153C636D7 for ; Fri, 10 Feb 2023 22:35:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233850AbjBJWfh (ORCPT ); Fri, 10 Feb 2023 17:35:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60022 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233638AbjBJWfe (ORCPT ); Fri, 10 Feb 2023 17:35:34 -0500 Received: from mail-ed1-x536.google.com (mail-ed1-x536.google.com [IPv6:2a00:1450:4864:20::536]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F53F2D45 for ; Fri, 10 Feb 2023 14:35:32 -0800 (PST) Received: by mail-ed1-x536.google.com with SMTP id fj20so6164699edb.1 for ; Fri, 10 Feb 2023 14:35:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=sgPQEqmErKQB0wG6VWCF+VmnzkMKfRqkz/sIKfZqL68=; b=gQz1/9xmHREGXPA2JXH0RsK7JsUhn7vHa15D/69fCSK/vZzwlw4bq85T8mRYkpJplP EegJvrfeGBLxDkz18RvpvK6JB/6GDTuCoFw9pDlWGUVTnbp7FP4QCEiSxJ0txMWl8p8y bbKRpYKHkKD8w9mPOUGxJllCwuJhuHiNZ3ZP0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sgPQEqmErKQB0wG6VWCF+VmnzkMKfRqkz/sIKfZqL68=; b=i2BZIrSnp79zsWXTsg/smeqS8XqcGDaByhhWkXfeKPsIHftmp/4EGtcTzfked+AxqV JpLkkNLn1Zt90op3XEo/UezHurPQHf5poTqsvhviNRoXDQMe9BR1dvyHezEa3bHwyE1Q aIfuIrBIPi916mddfN7yE2ww+5Jw/3bFeR5HzeeGb8cU2w8bOb+2qQI+9jUbvHjK8Gfj i+H7jUTmBRiJGIg1HoG3scL5ewZU3Yueb4BhUNYq9kHIVHuASwA2uLZ0vvYhKp7xJD1j sShsoLn82EyKzDgeZaIYuy8YX1en1Kefpf2//Fa41b/2YvB3BC/vbKjwjoqA7TyLhFAl rq7Q== X-Gm-Message-State: AO0yUKUEaolRcwaxbWhdIKm7PYEQW2B8Nu19m1NdJ3Yn+7AEwjn27b7M /AYjeR+B46aUysT6BZts8Ex9I2oAyxGgpOUGetU= X-Google-Smtp-Source: AK7set/P8k/2zHuoByYWLh+bznfyrQ+dmzkhd+LNfqsJMiHSipLcywdOuYPDzMcVDI1F8zHrRi6erA== X-Received: by 2002:a50:9b43:0:b0:4ab:1d33:69ba with SMTP id a3-20020a509b43000000b004ab1d3369bamr7687008edj.16.1676068530338; Fri, 10 Feb 2023 14:35:30 -0800 (PST) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com. [209.85.218.51]) by smtp.gmail.com with ESMTPSA id r12-20020a50c00c000000b0049dd7eec977sm2892561edb.41.2023.02.10.14.35.29 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 10 Feb 2023 14:35:29 -0800 (PST) Received: by mail-ej1-f51.google.com with SMTP id ud5so19484886ejc.4 for ; Fri, 10 Feb 2023 14:35:29 -0800 (PST) X-Received: by 2002:a17:906:fad2:b0:88d:d304:3424 with SMTP id lu18-20020a170906fad200b0088dd3043424mr1693934ejb.0.1676068528950; Fri, 10 Feb 2023 14:35:28 -0800 (PST) MIME-Version: 1.0 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> <824fa356-7d6e-6733-8848-ab84d850c27a@kernel.dk> In-Reply-To: <824fa356-7d6e-6733-8848-ab84d850c27a@kernel.dk> From: Linus Torvalds Date: Fri, 10 Feb 2023 14:35:11 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: copy on write for splice() from file to pipe? To: Jens Axboe Cc: Ming Lei , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 10, 2023 at 2:26 PM Jens Axboe wrote: > > > > (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. I actually very consciously did *not* want to add cases of generic_splice_read() "just because we can". I've been on a "let's minimize the reach of splice" thing for a while. I really loved Christoph's patches, even if I may not have been hugely vocal about it. His getting rid of set/get_fs() got rid of a *lot* of splice pain. And rather than try to make everything work with splice that used to work just because it fell back on read/write, I was waiting for actual regression reports. Even when splice fails, a lot of user space then falls back on read/write, and unless there is some really fundamental reason not to, I think that's always the right thing to do. So we do have a number of "add splice_write/splice_read" commits, but they are hopefully all the result of people actually noticing breakage. You can do git log --grep=36e2c7421f02 to see at least some of them, and I really don't want to see them without a "Reported-by" and an actual issue. Exactly because I'm not all that enamoured with splice any more. Linus