Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7066327pxb; Wed, 17 Feb 2021 23:51:18 -0800 (PST) X-Google-Smtp-Source: ABdhPJyELCv0UrbZmFvbY3B5gsNlMn8e5AfVqlbdADOLlqFoZrayx26dXFmkzlQuRynCnmd+BfpX X-Received: by 2002:a50:ee0e:: with SMTP id g14mr2820063eds.159.1613634678694; Wed, 17 Feb 2021 23:51:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613634678; cv=none; d=google.com; s=arc-20160816; b=0HhSqrvib18LiB18pyYeGVlZn2JsabrrU+bYlSRI6onfT9S7LQLhX5ZbA2vlZBFwJI ocj1k6JZmquX/UYnSmu1vNt2tknQEz9OycmI6oGe/0I6FppI7T/4/uGBjpaEEnN6IlfG PF+FjebwrxD6/aMRke+0WnwL4qr2x/F0XnR5t1oi0v519VbdnN5+Sx0ioBtj5bnX51Gv ooNMR/8IUgV1NqjbFIa58SBt7gpGoEeO2gMIV0fh4H5XMjUoJWD2K+Z06UnAWdKZ+dPI o8XG6HfYCoCJVEj4rTgr/W6v/upSnyDHyQFrFHEoqP/NSn6WicRjmu3tfeY0u2Str/V6 CN+w== 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=x/KF+DF1pYoW9EgF5c6O1WsHFfGsng3na0X3aUUo6kI=; b=oxp9E4rxAmUNJDQHlv7E7gFQtf0KSVqIVQmIMLNs+lAPcJIszogGrZg0Mc26ut7085 ASMoy/a0IJV9wNBgaS5Syw+7b2inNrXRQYYrQkNhZnv5CkJ0Ta8uTHKwArtpgkHHEEpo iumNJKIECOQaf8q4vEkgvjOrRYWyUd739663b7lmt28TrZVn8SibLD/Mpz3JebGM5WjX SUS9Ih3dyj8FGsm13HAWEmXVf7s76vwQCu/MQKlJZCLiOhaLHTK+rSGzq2IB6lYdJYr0 JT65a+Gze8df5Eiqe0X9zk3sk2frXJD5yr80Yl2wrJSWIbQENXqLaBxCeR5UnUS1tmsL +cLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=t2dYxkyq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-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 j10si3616028edj.128.2021.02.17.23.50.54; Wed, 17 Feb 2021 23:51:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=t2dYxkyq; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231370AbhBRHqq (ORCPT + 99 others); Thu, 18 Feb 2021 02:46:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44218 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230436AbhBRHo5 (ORCPT ); Thu, 18 Feb 2021 02:44:57 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4A0FC061786; Wed, 17 Feb 2021 23:44:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=x/KF+DF1pYoW9EgF5c6O1WsHFfGsng3na0X3aUUo6kI=; b=t2dYxkyqC2yN1twmdBB9+kkB9d fmKnH0oOks7QGRGWLRRBR62uPZkHvqo9FNkU934CuOVlaoEUD8Mo8rU1qNpv9FlFWMvzVmDIdACU9 +NUhDfEuslH5OSuaenz3NuIrjhDo8bbaE0QqKpI1Cbi4tRIKYu9vroSEPJWk2w2HL8cUiNj2u4esN gNV/+iTZZd2weGDgWeSXwEfI8v6+FjLjbdvwdG1hFqu+ySLzwe//64EG02TEZ7mTvBu3f4IzolTe7 kldFSx1OB0BVAGY6JWX8O6wj9GLH+t8gnDDaGsLP42abmiI4IbrTTVOL8p7iS/b3XDHXsOstjoHoV yMn932ng==; Received: from hch by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lCdyX-001Nra-QE; Thu, 18 Feb 2021 07:43:50 +0000 Date: Thu, 18 Feb 2021 07:43:49 +0000 From: Christoph Hellwig To: Luis Henriques Cc: Amir Goldstein , Jeff Layton , Steve French , Miklos Szeredi , Trond Myklebust , Anna Schumaker , Alexander Viro , "Darrick J. Wong" , Dave Chinner , Greg KH , Nicolas Boichat , Ian Lance Taylor , Luis Lozano , ceph-devel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-cifs@vger.kernel.org, samba-technical@lists.samba.org, linux-fsdevel@vger.kernel.org, linux-nfs@vger.kernel.org Subject: Re: [PATCH v3] vfs: fix copy_file_range regression in cross-fs copies Message-ID: <20210218074349.GB329605@infradead.org> References: <20210217172654.22519-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210217172654.22519-1-lhenriques@suse.de> X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Wed, Feb 17, 2021 at 05:26:54PM +0000, Luis Henriques wrote: > A regression has been reported by Nicolas Boichat, found while using the > copy_file_range syscall to copy a tracefs file. Before commit > 5dae222a5ff0 ("vfs: allow copy_file_range to copy across devices") the > kernel would return -EXDEV to userspace when trying to copy a file across > different filesystems. After this commit, the syscall doesn't fail anymore > and instead returns zero (zero bytes copied), as this file's content is > generated on-the-fly and thus reports a size of zero. > > This patch restores some cross-filesystems copy restrictions that existed > prior to commit 5dae222a5ff0 ("vfs: allow copy_file_range to copy across > devices"). It also introduces a flag (COPY_FILE_SPLICE) that can be used > by filesystems calling directly into the vfs copy_file_range to override > these restrictions. Right now, only NFS needs to set this flag. No need for the flag. Jyst fall back to splicing in the only caller that wants it.