From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C1FD3C4363A for ; Tue, 27 Oct 2020 09:57:15 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B7AFA21D24 for ; Tue, 27 Oct 2020 09:57:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B7AFA21D24 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=lst.de Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 4CL6Yz23ybzDqPb for ; Tue, 27 Oct 2020 20:57:11 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lst.de (client-ip=213.95.11.211; helo=verein.lst.de; envelope-from=hch@lst.de; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=lst.de Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4CL6WY6lMhzDq6k for ; Tue, 27 Oct 2020 20:55:01 +1100 (AEDT) Received: by verein.lst.de (Postfix, from userid 2407) id 98EC068AFE; Tue, 27 Oct 2020 10:54:55 +0100 (CET) Date: Tue, 27 Oct 2020 10:54:55 +0100 From: Christoph Hellwig To: David Howells Subject: Re: [PATCH 02/10] fs: don't allow splice read/write without explicit ops Message-ID: <20201027095455.GA30298@lst.de> References: <3088368.1603790984@warthog.procyon.org.uk> <20200827150030.282762-3-hch@lst.de> <20200827150030.282762-1-hch@lst.de> <3155818.1603792294@warthog.procyon.org.uk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3155818.1603792294@warthog.procyon.org.uk> User-Agent: Mutt/1.5.17 (2007-11-01) X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org, Al Viro , linux-fsdevel@vger.kernel.org, Linus Torvalds , Christoph Hellwig Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" On Tue, Oct 27, 2020 at 09:51:34AM +0000, David Howells wrote: > David Howells wrote: > > > > default_file_splice_write is the last piece of generic code that uses > > > set_fs to make the uaccess routines operate on kernel pointers. It > > > implements a "fallback loop" for splicing from files that do not actually > > > provide a proper splice_read method. The usual file systems and other > > > high bandwith instances all provide a ->splice_read, so this just removes > > > support for various device drivers and procfs/debugfs files. If splice > > > support for any of those turns out to be important it can be added back > > > by switching them to the iter ops and using generic_file_splice_read. > > > > Hmmm... this causes the copy_file_range() syscall to fail with EINVAL in some > > places where before it used to work. > > > > For my part, it causes the generic/112 xfstest to fail with afs, but there may > > be other places. > > > > Is this a regression we need to fix in the VFS core? Or is it something we > > need to fix in xfstests and assume userspace will fallback to doing it itself? > > That said, for afs at least, the fix seems to be just this: And that is the correct fix, I was about to send it to you. We can't have a "generic" splice using ->read/->write without set_fs, in addition to the iter_file_splice_write based version being a lot more efficient than what you had before.