Received: by 2002:a25:ca44:0:0:0:0:0 with SMTP id a65csp1526998ybg; Wed, 29 Jul 2020 17:08:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzx+hFQxspejbWryePI8XPmSwcrSR9KcDIEd5YaV+mtHQA7dOxCoTkR3sA1sjs4cteHRui5 X-Received: by 2002:a17:906:248b:: with SMTP id e11mr124764ejb.280.1596067735803; Wed, 29 Jul 2020 17:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596067735; cv=none; d=google.com; s=arc-20160816; b=BZnki+292LPw+ZNm4RW8obxbiotUi2VUpsrGJ0/H0aEF+hrRBDm+G3YaOqU7Q2oCnb fd4qdXa3Wqp3HF7pSDfp7+ZFHHamRE3DkXjxwXnz3Oqu0HiWhKEl9Xs/8k1Qs0/Rs59I TE6euY33uj4xqxyT1KqA5I0jKliYAaZ5jR1zG229bFEIHuZRxaFfDe5HJeiCJek27G8i bVPbIwQ5OfuudDsJclri67TZEDoP7KsJ0ObszXFFsZXEv3wAwiOb8ShgQN2TBVnvtMpO RTiRMULKWhZ1+lBdVHpXXH8bfxXegQfLlEOVgQXafo2Hm5zX70dJChuLN/caMcDA6b5h ACOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=f1CIEjGSfjQesEJLRuwVojXbb3xJlDYfuT6bWXrK2Wc=; b=AARNLJ8oWmnADJqg08gtbCz4DcryW6OYy4B81GAstqDtx1FCeGZGoGNSB/ZhrUowi+ j8jCv1yDYvyrtHv91IME5TIWmvXQhZkpW9V289fOiSfCmw0EEHmrFnUV/IBCKHJ7ZQUu C92Q8AijMjiAc8fFP8Gzsb3sIxpuSwQOe+W0B012wAMc+WJ8pVrOt7RfFz9P80/Yp+qJ e+Hyz77gplXy2ZUaMDV4KOD0Ag738Yf2pNg4JrsdOTos5LQCZWzVVrbYDZYRbPtGD4Yn aRaw/ZVZrgNqcbWLe3Z7F/+NzqPdGwy+pUNsckMhuLaUbY9H63S3T3uSg8hBfJVlEJCM lPgQ== 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 y9si1877476ejc.644.2020.07.29.17.08.33; Wed, 29 Jul 2020 17:08:55 -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 S1728030AbgG3AF6 (ORCPT + 99 others); Wed, 29 Jul 2020 20:05:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35762 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726709AbgG3AF6 (ORCPT ); Wed, 29 Jul 2020 20:05:58 -0400 Received: from ZenIV.linux.org.uk (zeniv.linux.org.uk [IPv6:2002:c35c:fd02::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B693BC061794; Wed, 29 Jul 2020 17:05:57 -0700 (PDT) Received: from viro by ZenIV.linux.org.uk with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k0w4u-005K7w-W4; Thu, 30 Jul 2020 00:05:45 +0000 Date: Thu, 30 Jul 2020 01:05:44 +0100 From: Al Viro To: Christoph Hellwig Cc: 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: <20200730000544.GC1236929@ZenIV.linux.org.uk> References: <20200707174801.4162712-1-hch@lst.de> <20200707174801.4162712-23-hch@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200707174801.4162712-23-hch@lst.de> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.