Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp7399488pxb; Thu, 18 Feb 2021 09:05:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJw9XtSfrv4C6SAeVtHtKxNW7u/XTlV1iS8y9sOE9TZVahXJEnZFwfG+g+MVfj9d4SbUr5Z3 X-Received: by 2002:a17:906:25c4:: with SMTP id n4mr4928414ejb.359.1613667925293; Thu, 18 Feb 2021 09:05:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613667925; cv=none; d=google.com; s=arc-20160816; b=kSh/0mixbEoWCWIr5ZeLlQ+JUaJRmWopKYrGI8GNRvFPvEFh1srjQGNjIgyxb96ORz GlpxhJkvREqCNw7Z1+gVVthhDyzGjMUeFQOMxqM1iTPUa4Ce5Y3BJSOHEEXBRqgGtMf5 NCzuPbgUPbcClnKCjVMHYDtvHASwHSqWkESPT3JBdyoXrrgW5bwDIIeFtiroMOaXMRMF Il6GRGHQ9VtRZKvqp0e390/YRxnRBt5sqXB/icFXRQOuxFpHwtx2peC5Ztff2w8pjdbq iRoSi441YB9REBZfN/dHXaEcQH4pXWvV/eA3frPP/xxr30qmEPphVeqqD3LDZzppzQO1 Q7GA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=y38daONDwdDmDv1VoddeHBWWftl202hO6P8yucZxYa8=; b=ZBEJCY8ii7mVo3w6bW05bEaiHrV6z2I3027zUibhRn/DLkKn/nksOTQ1rXVBEgLqxA NHvIlLkAJMaVG/9O0KLJ8voG2O/c9p/Xw77RIgyOpjj3mh2P1VvJOBub4bT5mxW2blKD Qf9B6OKZU3Y7nUZBVMCOAr4FgsKTeG4peIHxs5PLm5HHxlYp/q851ouwarciKn2hcB5A IMz5M0LY93L3FRopcZ/N2S5/OWO+VSa81PUeHqRdXl1QzNix8Kebb+59MU8pl5Tu80qS efBLyd8jsUF7fEluYDXpnTsd8UjF824XAG3mrSrJ6xJoABFvAnIu+LaasmEeoFxtt7Hz AUdA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@umich.edu header.s=google-2016-06-03 header.b=iNFjWjKl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si4489395edq.28.2021.02.18.09.04.58; Thu, 18 Feb 2021 09:05:25 -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=@umich.edu header.s=google-2016-06-03 header.b=iNFjWjKl; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=umich.edu Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231234AbhBRREE (ORCPT + 99 others); Thu, 18 Feb 2021 12:04:04 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233019AbhBRQ3n (ORCPT ); Thu, 18 Feb 2021 11:29:43 -0500 Received: from mail-ej1-x62c.google.com (mail-ej1-x62c.google.com [IPv6:2a00:1450:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8254EC061574; Thu, 18 Feb 2021 08:28:59 -0800 (PST) Received: by mail-ej1-x62c.google.com with SMTP id hs11so6718263ejc.1; Thu, 18 Feb 2021 08:28:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=umich.edu; s=google-2016-06-03; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=y38daONDwdDmDv1VoddeHBWWftl202hO6P8yucZxYa8=; b=iNFjWjKl+LQN0COFhBnybPiIzwQZeq8Ix9Q6VeVsYt0rK/aNZ2CJ8MGnct0Nn2Uq44 HkSGMORn3xukzFLyjCcoKGIp5LxBAd6UeElElN4KqyH6chlqEH2OTZWAMVZey9T/m2ws z9wIkKJaekgRy6SOjUdAjB3t3H8GCoyK4yI0XjwpQmOi4Mdm4DvieCwmo4GzDqp5788B Eg6Y8VCfYsymemfvGfC7VGF7AJty6+2K26GYFtEdYuZhHrdXANbWixTJG329KJFpE8HM Szr4l+twMHlN4WuxLmvOo9yhavF5EE/XWlSHyHrQF+UY3xBcyp9/PSYQQBciIvSR31Y0 hq7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=y38daONDwdDmDv1VoddeHBWWftl202hO6P8yucZxYa8=; b=Y5o19VpDbqcVFzF6J2Z31otZo0oyeoh2j+6sEpRROLv2GEH68oukY4iezokurCkK8Q gmLQVLfZVwEWdaRgu5nHmRjj3k63FGbuCet0TROfeJGy1vxjlPq2JZkxFEX1E+PETmJG nMRtNB8HbEmDRJr15++DG2VathV2Xw+A37755PtuMAIxateklFv/rWjOMsuRV6sJ968i T+mqjkHsqwjfK4nLsGCTDyKni1RIevgCx6zkYp9Fr7d02taKqt9ARW74dwx+I6nSQfz9 iaEekpUT0dNolVKnc8ywBJd0EiMS0Y7BHATtktzSTDvU6Tfua0YGuJCEChcL5wdUJgeu qG+w== X-Gm-Message-State: AOAM5313l5uHZwB8VCHhQAiunjfjbyWu6fR3x23LFMe96v7oVeArCs5B Xn0R5RG6suRumiQQ1qYrD6SpXqoeA8hOas6y+ls= X-Received: by 2002:a17:907:35ca:: with SMTP id ap10mr4739637ejc.451.1613665738066; Thu, 18 Feb 2021 08:28:58 -0800 (PST) MIME-Version: 1.0 References: <20210217172654.22519-1-lhenriques@suse.de> In-Reply-To: From: Olga Kornievskaia Date: Thu, 18 Feb 2021 11:28:47 -0500 Message-ID: Subject: Re: [PATCH v3] vfs: fix copy_file_range regression in cross-fs copies To: Amir Goldstein Cc: Luis Henriques , 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 , linux-kernel , CIFS , samba-technical , linux-fsdevel , linux-nfs Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Feb 18, 2021 at 1:48 AM Amir Goldstein wrote: > > On Thu, Feb 18, 2021 at 7:33 AM Olga Kornievskaia wrote: > > > > On Wed, Feb 17, 2021 at 3:30 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-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. > > > > > > 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 > > > Signed-off-by: Luis Henriques > > > --- > > > Ok, I've tried to address all the issues and comments. Hopefully this v3 > > > is a bit closer to the final fix. > > > > > > Changes since v2 > > > - do all the required checks earlier, in generic_copy_file_checks(), > > > adding new checks for ->remap_file_range > > > - new COPY_FILE_SPLICE flag > > > - don't remove filesystem's fallback to generic_copy_file_range() > > > - updated commit changelog (and subject) > > > Changes since v1 (after Amir review) > > > - restored do_copy_file_range() helper > > > - return -EOPNOTSUPP if fs doesn't implement CFR > > > - updated commit description > > > > In my testing, this patch breaks NFS server-to-server copy file. > > Hi Olga, > > Can you please provide more details on the failed tests. > > Does it fail on the client between two nfs mounts or does it fail > on the server? If the latter, between which two filesystems on the server? > It was a pilot error. V3 worked. I'm having some other issues with server to server copy code but they seem to be unrelated to this. I will test the new v6 versions when it comes out. > Thanks, > Amir.