Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2173615rwd; Fri, 19 May 2023 01:57:20 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5/ikthKXvizWwA8o7Sbh2V4t+9z+x9JMIx/GcUTSl6PEVFho0XjT+vuvpoaK0w067U3oR8 X-Received: by 2002:a17:90b:1d83:b0:24e:31bd:5079 with SMTP id pf3-20020a17090b1d8300b0024e31bd5079mr1460424pjb.18.1684486640603; Fri, 19 May 2023 01:57:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684486640; cv=none; d=google.com; s=arc-20160816; b=ZcTB4LD4jHUnkHOTK+AA5BLylWTHFhbGeymyS2ORIdap32xpP7QuNBn3kym8ruevs8 Y1iNB9IHAWi7g5YF/W8UplbioNNayczxKx87Zn7+zzhz5QRctgSoUAmwdR6kAnmxE1X8 bMqFnsOCf6SdgrHEVTO1zi5fJKaqcIzaGsXtrsqKVPP84K21+9hPr/AffCm8RPqbJf0+ HFjZZ1rsaZD+CgjS+pg6CYFKbxf5CFNLmP1FDdYPulJoOw2XeCBiTN3vcUVEii4+5Emf MTPflqxpWNvAU1pAg/YaHbxC6vrnGr45bG4xC6+dctgTX54P9BqTNdCj3t8ykz57U1vj kXhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZAbGvedE1BQJOMrbfCufZTyJ4e2EZLn0BqAhB63sICY=; b=zpMHkr8RUvN2vxmM3BYKcNEHuz9/SjN2+ikPK2A98SFT48TgztznLmFAo7hgdZmZl6 6ylRC//H+5VkF5xonlAvE7f9t7Ltpgiow22nSyMXEWLUKywQbAMplV/PkpAuPePV0st0 kcMsW7ASoYgT9cm9tEGQi7WNSU3Q08YhjxVLHl0KAQlDrKh007srogQMK3uxpkV4CL3E RctF5I1XDtlj9yrM5NMV9GmP55nw2u0aTa6lRbF9Hq4A97XCFwAeS/Xq0NiBCqAIoedn AD1wu+Aq839eTFdZhNWKqJvSMdz30J+OIW/A7EUMzFrP004mRRTo4m3/UNzpDsrlHZ4R sThg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=bRy4xB+F; 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 t2-20020a17090a3e4200b0024753ec4dccsi1350876pjm.124.2023.05.19.01.57.07; Fri, 19 May 2023 01:57:20 -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=@infradead.org header.s=bombadil.20210309 header.b=bRy4xB+F; 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 S230357AbjESIsO (ORCPT + 99 others); Fri, 19 May 2023 04:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37986 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230429AbjESIsM (ORCPT ); Fri, 19 May 2023 04:48:12 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2C88A180; Fri, 19 May 2023 01:48:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZAbGvedE1BQJOMrbfCufZTyJ4e2EZLn0BqAhB63sICY=; b=bRy4xB+F05w3yUcX9Qj7jsXixk UiPK2HdtbtcNlpwDDsAwCjjVN21Tp6m1GqZVtPqu51Zhc6QFKauy/qn1GcXC52/0SNNQKgEZeknSX 1dCTZoBtDIOdxZuKa757Yd+g3fbdTG/klmlaRG2fFtO15XaDjQqvTdwnk/Tpkz2ldnTO37pUBCiMF LOHeUyGfWDuTGQyuyG3p0D7oGhKcYZggXCvVyz5lpXq3AzvG08oK2f3l3T/faSWz+kBHPlw8dAMTT 1OJKf6iOGpmKMWIapyjTFeN5r/xDRyfa5hfC5eSXLwrEQyVOiwkPSqmZunppGfp65GiofaE2or3W+ wUeaUBzw==; Received: from hch by bombadil.infradead.org with local (Exim 4.96 #2 (Red Hat Linux)) id 1pzvmI-00FZoD-04; Fri, 19 May 2023 08:47:58 +0000 Date: Fri, 19 May 2023 01:47:57 -0700 From: Christoph Hellwig To: David Howells Cc: Christoph Hellwig , Jens Axboe , Al Viro , Matthew Wilcox , Jan Kara , Jeff Layton , David Hildenbrand , Jason Gunthorpe , Logan Gunthorpe , Hillf Danton , Christian Brauner , Linus Torvalds , linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Christoph Hellwig Subject: Re: [PATCH v20 03/32] splice: Make direct_read_splice() limit to eof where appropriate Message-ID: References: <20230519074047.1739879-1-dhowells@redhat.com> <20230519074047.1739879-4-dhowells@redhat.com> <1742093.1684485814@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1742093.1684485814@warthog.procyon.org.uk> X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham 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 Fri, May 19, 2023 at 09:43:34AM +0100, David Howells wrote: > > direct_read_splice (which also appears a little misnamed) really is > > a splice by calling ->read_iter helper. > > It can be renamed if you want a different name. copy_splice_read() or > copy_splice_read_iter()? Maybe something like that, yes. > > > I we don't do any of this validtion we can just call it directly from > > splice.c instead of calling into ->splice_read for direct I/O and DAX and > > remove a ton of boilerplate code. > > There's a couple of places where we might not want to do that - at least for > non-DAX. shmem and f2fs for example. f2fs calls back to buffered reading > under some circumstances. shmem ignores O_DIRECT and always splices from the > pagecache. So? even if ->read_iter does buffered I/O for O_DIRECT it will still work. This can in fact happen for many other file systems due when they fall back to buffeed I/O due to various reasons.