Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp2169296rwd; Fri, 19 May 2023 01:52:10 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ64G21V/YzsqfxntJ//3H9T1aWZ5dB3f9noaV2EQ6U0m2GTXRW1VyR9IJVT9caMuki6nqyw X-Received: by 2002:a17:903:2303:b0:1ae:610a:4a46 with SMTP id d3-20020a170903230300b001ae610a4a46mr2235773plh.47.1684486330457; Fri, 19 May 2023 01:52:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684486330; cv=none; d=google.com; s=arc-20160816; b=RFTvOR5KxaQNK0WVC/EJ1YPqBI4xIxY+t/odaNZgn49Z3tLfx+lZMOgqMmht/9RcyE XLc89bejoGB2g97m2vDxaS+BSqAgUNs1PM8msZobln2ShNIv+CloRP8I9WVeGVHO8BHc 2+mDSblZNYPBXv3tr8TS4sNs4+1GGFnj/mH6rAsO+4g4AHnKXFEslwBQTS9yqtcpfaYI LowZwh68cHV0aJFtVMuiai43aXyuvYP5MNjE9TKlJ6lfEvEs11wBH5HyWuaCyHZKuPXH 658tLjvVQ2jiF7OthGsSomzgjE8D7vmC2Crx5BuvkwchefRycvJf67zyCIblGCl4N9Rq aO5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:content-id:mime-version:subject :cc:to:references:in-reply-to:from:organization:dkim-signature; bh=XqulE8q9IX0TG97OlqccamVpFcIlEkKL1KejXgaitAk=; b=x4NdDdzSkCVLcKmYVOjS3nUX6gT2rjU8yRdW7DoaWDV7sNPnLTgCD3Lv3X8KsFZkRh PJtr1L4qy/QijFJGRStacMsfRbQ+MK8yKQ7Mg3rY2P5pELMf66nHYtOJ+gH/7wafTsI0 7jqPMebukeouggERdxP5c1GZvLBC2Wb/ftfk2yzb4a7iWB+waeQoPJs6JAUCD7Y45/n2 QPGMofx8rAlNI5VD3Ixv4qu99OGNp2Htgcny78nbwINWlcOurjkmUJIJJW5w2QsZuPK9 pRvYFHoV5fTETuxxuQBMOyqE9erWYP9cwdPxrDYG4QnTo9UCs0RuwcXpR0A4g6jkRUh1 OlzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=dfOqYPti; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ix5-20020a170902f80500b001ae21cd0fafsi3266312plb.38.2023.05.19.01.51.55; Fri, 19 May 2023 01:52:10 -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=@redhat.com header.s=mimecast20190719 header.b=dfOqYPti; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230473AbjESIoh (ORCPT + 99 others); Fri, 19 May 2023 04:44:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230032AbjESIof (ORCPT ); Fri, 19 May 2023 04:44:35 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AAD87E66 for ; Fri, 19 May 2023 01:43:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1684485824; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=XqulE8q9IX0TG97OlqccamVpFcIlEkKL1KejXgaitAk=; b=dfOqYPti2SNSJVRLs14F+WhrM2b5gPjTvWuVVthWp3+mXsPrG44iFytc08vTn/cWcw6tg7 qgmo6/bA2ojYlaahnASKcIHnCeHIMgJQNZ+gDlads9BwigdMFg++SvanTqLaBc2MmQWNG4 kN0sItR0t/Ya1y72oesHfm+IYpEoMow= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-210-RPMCJFogMQCYbOjG6Sj0GA-1; Fri, 19 May 2023 04:43:39 -0400 X-MC-Unique: RPMCJFogMQCYbOjG6Sj0GA-1 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 5319B3802AC6; Fri, 19 May 2023 08:43:38 +0000 (UTC) Received: from warthog.procyon.org.uk (unknown [10.42.28.221]) by smtp.corp.redhat.com (Postfix) with ESMTP id 0D3F840C6CCD; Fri, 19 May 2023 08:43:34 +0000 (UTC) Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United Kingdom. Registered in England and Wales under Company Registration No. 3798903 From: David Howells In-Reply-To: References: <20230519074047.1739879-1-dhowells@redhat.com> <20230519074047.1739879-4-dhowells@redhat.com> To: Christoph Hellwig Cc: dhowells@redhat.com, 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 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1742092.1684485814.1@warthog.procyon.org.uk> Date: Fri, 19 May 2023 09:43:34 +0100 Message-ID: <1742093.1684485814@warthog.procyon.org.uk> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.2 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Christoph Hellwig wrote: > I'm really not sure if this is a good idea. Right now > 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()? > 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. David