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 13038C6379F for ; Thu, 9 Feb 2023 20:33:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230029AbjBIUdN (ORCPT ); Thu, 9 Feb 2023 15:33:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38726 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229539AbjBIUdL (ORCPT ); Thu, 9 Feb 2023 15:33:11 -0500 Received: from hr2.samba.org (hr2.samba.org [IPv6:2a01:4f8:192:486::2:0]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7FCA62D156; Thu, 9 Feb 2023 12:33:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=samba.org; s=42; h=Message-ID:Cc:To:From:Date; bh=8lKrEZV9yEJIi0kn0dn+QeXatghJ23bQPCt58aXU5vk=; b=Z0gY7l7FeI7MJx19vhNl6NnbDu 8xSDF8e5b9YUCAK3UUK8QxLZecE0pnvOvxwtqwJFCqoL5n4/QOgDaxH/g0z0Lvm4pLDD7nPTmp70E LgTLVc0mjTeFBy41EZK6oxCrkDx2BrN4y1v+Xi807y3QLOTcFM130sdSD9Ic+uyoeh+8ayqGKSZGI 0SU3ycY+SWwXkIuQJDsnpwqO9wSmQ0vxoT04q2dBeyOMptdo3dTXddhJ96BSQXVhZGpGAMUBgTiwu GCzlwCCC59bwKGaMcI6YciLBEHKKOucH2zTdzeaO5BMeZ0PEK6JYTr917AkEkWjl9BBpNTqxfEHhe NAJjwlngIEA9L2pEpt7WU+OshjR/7EfRRqs+ZUTEbROgH9ynob+3bB9oYICMSR9J9wqISR9oh4xvf rL87QFt8m+WLjNQfd5aTlabU/MQt7NCu9J5FOQVvw6aVOL+kvbWTX1uezc2//GiplGcL4/yVWzXwQ N1BFCjs14bjZ0GX/JlSygJZb; Received: from [127.0.0.2] (localhost [127.0.0.1]) by hr2.samba.org with esmtpsa (TLS1.3:ECDHE_SECP256R1__ECDSA_SECP256R1_SHA256__CHACHA20_POLY1305:256) (Exim) id 1pQDbM-00CsAc-96; Thu, 09 Feb 2023 20:33:04 +0000 Date: Thu, 9 Feb 2023 12:33:00 -0800 From: Jeremy Allison To: Linus Torvalds Cc: Stefan Metzmacher , Jens Axboe , Linux API Mailing List , Samba Technical , "linux-kernel@vger.kernel.org" , Al Viro , linux-fsdevel , io-uring Subject: Re: copy on write for splice() from file to pipe? Message-ID: Reply-To: Jeremy Allison References: <0cfd9f02-dea7-90e2-e932-c8129b6013c7@samba.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Feb 09, 2023 at 11:48:35AM -0800, Linus Torvalds via samba-technical wrote: > >So this is exactly *why* splicing from a file all the way to the >network will then show any file changes that have happened in between >that "splice started" and "network card got the data". You're supposed >to use splice only when you can guarantee the data stability (or, >alternatively, when you simply don't care about the data stability, >and getting the changed data is perfectly fine). Metze, correct me if I'm wrong but isn't this exactly the "file is leased in SMB3" case ? We already know if a file is leased, and so only use the splice calls for I/O in that case, and fall back to the slower calls in the non-leased case.