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,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 09993C43381 for ; Thu, 18 Feb 2021 17:09:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C6A3A64EAD for ; Thu, 18 Feb 2021 17:09:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232059AbhBRRIF (ORCPT ); Thu, 18 Feb 2021 12:08:05 -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-Google-Smtp-Source: ABdhPJzGgUkLYZUEL1Zpo08T7oMdth0EfHuMaJ6hNGLf8X0W8W6hosNZC+ES+g1w9t5wa73zBypNYGQnlkbDPFG7yko= 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-cifs@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.