Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1710917ybg; Thu, 30 Jul 2020 00:04:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwJzZVv00RwBZPaiMV5QM12AJSemjtlXKF3KG3cXyHmx9LDenp8LNSAPD6xTmlDAGUpSB+X X-Received: by 2002:a50:d655:: with SMTP id c21mr1258587edj.49.1596092697838; Thu, 30 Jul 2020 00:04:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596092697; cv=none; d=google.com; s=arc-20160816; b=g3alikh2G7XcWSsO0IIhS9zdK4TzxQWJUxPz4Vp3nvOGLr+1u2xgzizJL9k4gSE4tL Ll7OTAvO5Ns/AIuYnOPhrxth+Pi8cqeMXwK4pp4x8yDzIgqzDjCS99DmPCuRM7pNj70p 2DI3DpgRtWiUNp16bokWIEfngjBh1WgaoiA4B54KMyKKvcsHxPhU9Pga0wrbGzlMn6cv yUUDCf2XIatW88xWo1q+WGE4nVM30BGYeo33WBzpQDrcy8/jNwwImpzO29b2Xa+tno/3 sWZTVPVps9NbI/Im23ldCzyleGXjyKVx7eZSRgfSSUs3K4LFOS8ks9sOzI96d/MMROfw NlWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=mUZPh52Hz6OUnCaEhatZ6TpQHj2D9g/SsL/ymt9G5xQ=; b=abv5JGWcSae0+Rd7hw2bENpYnNVYJU8m+AwkHy0mlEt5xkh9zUqd05dN4+KAbkJ5Om ULuCqcXKY3iUEdX+Kox8eZW0Ano8Se7k7/9IHUuycRm2SCYqZ2OqHsun/KU6yBPKKxaU SKQlCEVL93kHSx/w8OLy7DQy626jBfxxZF/sWAmf6cdkPry11TwsGiTri8tYytFd9jgu l/Edh/9E9L9fxzqoDHATX8ey+ac7LfbtXRab4sy7r1grkP9t1t54T1E+RHKEd4dtW/c7 6aJ6MHufmP8SDzU8OYdE9gkYNg3M/cbufPcMp8pIkG554PO/W4JRgbVgs2bFQBfO6LOy z4bQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si2742323edr.130.2020.07.30.00.04.35; Thu, 30 Jul 2020 00:04:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgG3HDc (ORCPT + 99 others); Thu, 30 Jul 2020 03:03:32 -0400 Received: from verein.lst.de ([213.95.11.211]:54769 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726133AbgG3HDc (ORCPT ); Thu, 30 Jul 2020 03:03:32 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id 9FD0D68AFE; Thu, 30 Jul 2020 09:03:29 +0200 (CEST) Date: Thu, 30 Jul 2020 09:03:29 +0200 From: Christoph Hellwig To: Al Viro Cc: Christoph Hellwig , Linus Torvalds , Stephen Rothwell , Luis Chamberlain , Matthew Wilcox , Kees Cook , Iurii Zaikin , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org Subject: Re: [PATCH 22/23] fs: default to generic_file_splice_read for files having ->read_iter Message-ID: <20200730070329.GB18653@lst.de> References: <20200707174801.4162712-1-hch@lst.de> <20200707174801.4162712-23-hch@lst.de> <20200730000544.GC1236929@ZenIV.linux.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200730000544.GC1236929@ZenIV.linux.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 30, 2020 at 01:05:44AM +0100, Al Viro wrote: > On Tue, Jul 07, 2020 at 07:48:00PM +0200, Christoph Hellwig wrote: > > If a file implements the ->read_iter method, the iter based splice read > > works and is always preferred over the ->read based one. Use it by > > default in do_splice_to and remove all the direct assignment of > > generic_file_splice_read to file_operations. > > The worst problem here is the assumption that all ->read_iter() instances > will take pipe-backed destination; that's _not_ automatically true. > In particular, it's almost certainly false for tap_read_iter() (as > well as tun_chr_read_iter() in IFF_VNET_HDR case). > > Other potentially interesting cases: cuse and hugetlbfs. > > But in any case, that blind assertion ("iter based splice read works") > really needs to be backed by something. I think we need to fix that in the instances, as we really expect ->splice_read to just work instead of the caller knowing what could work and what might not.