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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS 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 78074C43460 for ; Fri, 23 Apr 2021 04:41:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 51CA1613AD for ; Fri, 23 Apr 2021 04:41:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229643AbhDWEle (ORCPT ); Fri, 23 Apr 2021 00:41:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54098 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229624AbhDWEld (ORCPT ); Fri, 23 Apr 2021 00:41:33 -0400 Received: from mail-ua1-x932.google.com (mail-ua1-x932.google.com [IPv6:2607:f8b0:4864:20::932]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A3D76C06138B for ; Thu, 22 Apr 2021 21:40:56 -0700 (PDT) Received: by mail-ua1-x932.google.com with SMTP id s2so14890460uap.1 for ; Thu, 22 Apr 2021 21:40:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=cYjZlbF3DXM7zGnEvoUEauj9qs95JDVKd+qkmT8E5Es=; b=Sz162M5Od95RKrPl3X/Ac4xcDjeMsrrM/4Xt3pyER0eWJaPxr1EiE1YWPdfvaRqo8Z 9BuZXgXl61gDrjkAfvHLKWCwv0Hz3q0z5HGKJCQkDs0zZc1hd1SYYMVD4xhYjVO1eYBK nUrplSbXYGSOOCNOwNBzogI6pG1sjmuXCgXbc= 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=cYjZlbF3DXM7zGnEvoUEauj9qs95JDVKd+qkmT8E5Es=; b=etczfbQ1BIyBnQwij2fK4vhPEdNvjP2my2HOmlNTwsawz6UEFlevFSqfK6aWjbhGPm T1tOmZ/uIoncwYwMX0+F+PNuDNu8W/kjyFLBwna2jM4iii8tgaY9D/saqw7vBdURgzXq ZKiGtBYBJ4INSadykKHDMZTWYy5G0tWhEwsw3OM8iVbcTnw9MMU1wDFHqmUIItXoonUA lDD1cBtpT9U5KvoUfBZGVmfb5b/1uYuBPVKlaiOe5aKjGuD3m2sxV/I3DLx6IWpn8Abv 35fXIsaQTSORo2xy/YHeP7m6niCfH6wYTaiBUQjLGLzCZuYsqa0MRCDbYPqMW9+FD2Sm JuhQ== X-Gm-Message-State: AOAM531mttRxzG+n+aMMBWwHMT0JP+rjc1xARLzJHixi0TtjThdDlWT6 QfEVHTW0N2SR0PyGLfkBiH8cj7CrpxCEiwv21P2gXQ== X-Google-Smtp-Source: ABdhPJxN50JqYMGhnzwmNIzBqf5XELBKZ9iKqf346L2CEQrzbVJ1FDlyDZ16cLmlLwpKkRZI87JeC+iOPw+JE+Tq628= X-Received: by 2002:ab0:638e:: with SMTP id y14mr1572161uao.82.1619152855684; Thu, 22 Apr 2021 21:40:55 -0700 (PDT) MIME-Version: 1.0 References: <20210221195833.23828-1-lhenriques@suse.de> <20210222102456.6692-1-lhenriques@suse.de> <8735vzfugn.fsf@suse.de> In-Reply-To: From: Nicolas Boichat Date: Fri, 23 Apr 2021 12:40:44 +0800 Message-ID: Subject: Re: [PATCH v8] vfs: fix copy_file_range regression in cross-fs copies To: Amir Goldstein Cc: Luis Henriques , "Darrick J. Wong" , Olga Kornievskaia , Jeff Layton , Steve French , Miklos Szeredi , Trond Myklebust , Anna Schumaker , Alexander Viro , Dave Chinner , Greg KH , Ian Lance Taylor , Luis Lozano , Andreas Dilger , Christoph Hellwig , 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: ceph-devel@vger.kernel.org On Fri, Apr 9, 2021 at 9:50 PM Amir Goldstein wrote: > > On Fri, Apr 9, 2021 at 4:39 PM Luis Henriques wrote: > > > > Nicolas Boichat writes: > > > > > On Wed, Feb 24, 2021 at 6:44 PM Nicolas Boichat wrote: > > >> > > >> On Wed, Feb 24, 2021 at 6:22 PM Luis Henriques wrote: > > >> > > > >> > On Tue, Feb 23, 2021 at 08:00:54PM -0500, Olga Kornievskaia wrote: > > >> > > On Mon, Feb 22, 2021 at 5:25 AM 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 > > >> > > > Signed-off-by: Luis Henriques > > >> > > > > >> > > I tested v8 and I believe it works for NFS. > > >> > > > >> > Thanks a lot for the testing. And to everyone else for reviews, > > >> > feedback,... and patience. > > >> > > >> Thanks so much to you!!! > > >> > > >> Works here, you can add my > > >> Tested-by: Nicolas Boichat > > > > > > What happened to this patch? It does not seem to have been picked up > > > yet? Any reason why? > > > > Hmm... good question. I'm not actually sure who would be picking it. Al, > > maybe...? > > > > Darrick, > > Would you mind taking this through your tree in case Al doesn't pick it up? Err, sorry for yet another ping... but it would be good to move forward with those patches ,-P Thanks! > Thanks, > Amir.