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=-10.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=unavailable 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 7EF91C11F68 for ; Wed, 30 Jun 2021 15:06:13 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6860A61477 for ; Wed, 30 Jun 2021 15:06:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235687AbhF3PIl (ORCPT ); Wed, 30 Jun 2021 11:08:41 -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