Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp402109pxv; Wed, 30 Jun 2021 08:09:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxgj0H6atyO3f8siE2qUaVZg+FQUv5b1AllIJQ72S6xq+EL7JWgOdXdGY3/r/NmyYWpFhLA X-Received: by 2002:a05:6402:5111:: with SMTP id m17mr37101962edd.219.1625065791001; Wed, 30 Jun 2021 08:09:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625065790; cv=none; d=google.com; s=arc-20160816; b=lgp1nSLkUKZEiEE447KWQDOIpx3wH57B0qVqCiIpphs8MyjpekKrY9fWxvW8+BHrOf IKhrA2yO8TnICLStS7OGcxXLQhE3H4K1mqnK4Cu0AaIePbqEBVuYE64TCPJ2xRf/TTUc jpdLgwsPaA8n128yrPx60/b6IqlF+mt9AgXQzp6Q/WvrgmcvxD5Do3YICp2AMK7/Pd5G drUKuslYNcAp/F0Ss3LtAtw4s/gOTKWtfQGbcYaFDraDfY123K64PKX10qyqTO1HPMy9 IxJuYTQLJf8KOSlbg318LQL2H1wgHYltxOt0PspHR6KkigFRL5qHUAEr0Tb8U2lx/y40 zRiw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:dkim-signature:dkim-signature :dkim-signature; bh=e83E/uBs3EEaF5PdmWJZN8o1DNeX+cP8Kros1I/iaIM=; b=KB+IN3UlWbAKalpLkotVSov6KSkp6POxzXQ6qw6ofiw6JEz+1TqL8pDeyLNUn6qAXK 2nru/1soHx/I7/0QbYgCpWjSs4EJP1DdIqgotufiMLslBAlRYYnVwGPImOoRs1Ycvm9J UMtlP04hw5lr3PL62yvUw/oJ66x2RNSqXNVy8BmsE9RHF+mLocrXCHXyWIOVgkT1Xrwx B+JD012t3ald4mUZF8VWo3Pq2NZRYdRhbkK4mJkMUabhfihDE2U5LPJ/WLr0F3R2cotv yHjkWjElC+O/ZJoUrE9WPypRjoUFycdxzrBpMlLVpzG5FMKyXrhg1xVcb13y5O54e5gf lQpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i8j3M07f; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=398dourg; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i8j3M07f; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=398dourg; 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 f19si21435424edu.388.2021.06.30.08.09.27; Wed, 30 Jun 2021 08:09:50 -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; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i8j3M07f; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=398dourg; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=i8j3M07f; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=398dourg; 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 S235537AbhF3PIk (ORCPT + 99 others); Wed, 30 Jun 2021 11:08:40 -0400 Received: from smtp-out1.suse.de ([195.135.220.28]:48990 "EHLO smtp-out1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235352AbhF3PIk (ORCPT ); Wed, 30 Jun 2021 11:08:40 -0400 Received: from imap.suse.de (imap-alt.suse-dmz.suse.de [192.168.254.47]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3115222770; Wed, 30 Jun 2021 15:06:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625065570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e83E/uBs3EEaF5PdmWJZN8o1DNeX+cP8Kros1I/iaIM=; b=i8j3M07faKq9TQBenVIfdZmIALxxxTu7PENlW3xjdfHTWN0l/Eqvg23R0Lp/PyHD/zLyiZ nPHsgkm6TDd+LwDXm9GNcqRNV3xG6h/ef+6SU+nZyX1k1UUA/1pjAljHDYF0EDpShdXNG6 SMFjl6xAYo2xvWkN47uboGENzC/42AI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625065570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e83E/uBs3EEaF5PdmWJZN8o1DNeX+cP8Kros1I/iaIM=; b=398dourgC4zMm+NCPvIKaN3ye7FhTwm6y7xRyFthUtb//n1BCl4M6siuOUIiKm5LLjCdnT 8geb4pFyLXxrmyBg== Received: from imap3-int (imap-alt.suse-dmz.suse.de [192.168.254.47]) by imap.suse.de (Postfix) with ESMTP id A762F118DD; Wed, 30 Jun 2021 15:06:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1625065570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e83E/uBs3EEaF5PdmWJZN8o1DNeX+cP8Kros1I/iaIM=; b=i8j3M07faKq9TQBenVIfdZmIALxxxTu7PENlW3xjdfHTWN0l/Eqvg23R0Lp/PyHD/zLyiZ nPHsgkm6TDd+LwDXm9GNcqRNV3xG6h/ef+6SU+nZyX1k1UUA/1pjAljHDYF0EDpShdXNG6 SMFjl6xAYo2xvWkN47uboGENzC/42AI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1625065570; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=e83E/uBs3EEaF5PdmWJZN8o1DNeX+cP8Kros1I/iaIM=; b=398dourgC4zMm+NCPvIKaN3ye7FhTwm6y7xRyFthUtb//n1BCl4M6siuOUIiKm5LLjCdnT 8geb4pFyLXxrmyBg== Received: from director2.suse.de ([192.168.254.72]) by imap3-int with ESMTPSA id HM16JWGI3GBINAAALh3uQQ (envelope-from ); Wed, 30 Jun 2021 15:06:09 +0000 Received: from localhost (brahms [local]) by brahms (OpenSMTPD) with ESMTPA id 02e01176; Wed, 30 Jun 2021 15:06:08 +0000 (UTC) Date: Wed, 30 Jun 2021 16:06:08 +0100 From: Luis Henriques To: Amir Goldstein Cc: Alexander Viro , linux-fsdevel , linux-kernel , Nicolas Boichat , Olga Kornievskaia , Petr Vorel , kernel test robot Subject: Re: [PATCH v10] vfs: fix copy_file_range regression in cross-fs copies Message-ID: References: <20210630134449.16851-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 30, 2021 at 05:56:34PM +0300, Amir Goldstein wrote: > On Wed, Jun 30, 2021 at 4:44 PM 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-filesystem copy restrictions that existed > > prior to commit 5dae222a5ff0 ("vfs: allow copy_file_range to copy across > > devices"). Filesystems are still allowed to fall-back to the VFS > > generic_copy_file_range() implementation, but that has now to be done > > explicitly. > > > > nfsd is also modified to fall-back into generic_copy_file_range() in case > > vfs_copy_file_range() fails with -EOPNOTSUPP or -EXDEV. > > > > Fixes: 5dae222a5ff0 ("vfs: allow copy_file_range to copy across devices") > > Link: https://lore.kernel.org/linux-fsdevel/20210212044405.4120619-1-drinkcat@chromium.org/ > > Link: https://lore.kernel.org/linux-fsdevel/CANMq1KDZuxir2LM5jOTm0xx+BnvW=ZmpsG47CyHFJwnw7zSX6Q@mail.gmail.com/ > > Link: https://lore.kernel.org/linux-fsdevel/20210126135012.1.If45b7cdc3ff707bc1efa17f5366057d60603c45f@changeid/ > > Reported-by: Nicolas Boichat > > Reported-by: kernel test robot > > Signed-off-by: Luis Henriques > > --- > > Changes since v9 > > - the early return from the syscall when len is zero now checks if the > > filesystem is implemented, returning -EOPNOTSUPP if it is not and 0 > > otherwise. Issue reported by test robot. > > What issue was reported? Here's the link to my previous email: https://lore.kernel.org/linux-fsdevel/877dk1zibo.fsf@suse.de/ ... which reminds me that I need to also send a patch to fix the fstest. (Although the test as-is actually allowed to find this bug...) Cheers, -- Lu?s