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=-16.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,INCLUDES_PATCH, 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 966E1C4332B for ; Thu, 4 Mar 2021 17:15:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6463D64F59 for ; Thu, 4 Mar 2021 17:15:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239153AbhCDRPA (ORCPT ); Thu, 4 Mar 2021 12:15:00 -0500 Received: from mail.kernel.org ([198.145.29.99]:36886 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239072AbhCDROb (ORCPT ); Thu, 4 Mar 2021 12:14:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 960E464F1E; Thu, 4 Mar 2021 17:13:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1614878030; bh=lqO7UkOMXWWQHikCfDTDyGiTWusKSlro4VEZN21pRgk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=c7RhJ2hkF22/QR6Ws+Ygt5m539P7TU2r4XRQOb1j2WGhUQwtrop0RLw0uZ+MemZzU hqmLenKN93+rdtIUoh0Fexx5dW7WA9hjA149SdKqlDG714eINwMfIAacaBtKIPNrCO oPQcTLzT77A4g8h4dFkceukCFmK6HQt644bGSVLv6v1SEsYKakk60fXnpjHJJcWsOD 67oPOglMCgjQbzitpIhyT0NGM9vzd9Fd2IdZvQbZHSiTcYiaexbIBXyfSvFoObOm1Z I2afWFBzXpFOqxhrtSiwJ5I4YY8CDrJTGEMxNUL+2Sy61o7bLMURkAx1jpnQg4oAkY LmWjhrD0TModA== Date: Thu, 4 Mar 2021 09:13:50 -0800 From: "Darrick J. Wong" To: Alejandro Colomar Cc: linux-man@vger.kernel.org, Amir Goldstein , Michael Kerrisk , Luis Henriques , Steve French , Greg KH , Anna Schumaker , Jeff Layton , Miklos Szeredi , Trond Myklebust , Alexander Viro , "Darrick J. Wong" , Dave Chinner , Nicolas Boichat , Ian Lance Taylor , Luis Lozano , Andreas Dilger , Olga Kornievskaia , Christoph Hellwig , ceph-devel , linux-kernel , CIFS , samba-technical , linux-fsdevel , Linux NFS Mailing List , Walter Harms Subject: Re: [RFC v4] copy_file_range.2: Update cross-filesystem support for 5.12 Message-ID: <20210304171350.GC7267@magnolia> References: <20210224142307.7284-1-lhenriques@suse.de> <20210304093806.10589-1-alx.manpages@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210304093806.10589-1-alx.manpages@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org On Thu, Mar 04, 2021 at 10:38:07AM +0100, Alejandro Colomar wrote: > Linux 5.12 fixes a regression. > > Cross-filesystem (introduced in 5.3) copies were buggy. > > Move the statements documenting cross-fs to BUGS. > Kernels 5.3..5.11 should be patched soon. > > State version information for some errors related to this. > > Reported-by: Luis Henriques > Reported-by: Amir Goldstein > Related: > Cc: Greg KH > Cc: Michael Kerrisk > Cc: Anna Schumaker > Cc: Jeff Layton > Cc: Steve French > Cc: Miklos Szeredi > Cc: Trond Myklebust > Cc: Alexander Viro > Cc: "Darrick J. Wong" > Cc: Dave Chinner > Cc: Nicolas Boichat > Cc: Ian Lance Taylor > Cc: Luis Lozano > Cc: Andreas Dilger > Cc: Olga Kornievskaia > Cc: Christoph Hellwig > Cc: ceph-devel > Cc: linux-kernel > Cc: CIFS > Cc: samba-technical > Cc: linux-fsdevel > Cc: Linux NFS Mailing List > Cc: Walter Harms > Signed-off-by: Alejandro Colomar > --- > > v3: > - Don't remove some important text. > - Reword BUGS. > v4: > - Reword. > - Link to BUGS. > > Thanks, Amir, for all the help and better wordings. > > Cheers, > > Alex > > --- > man2/copy_file_range.2 | 27 +++++++++++++++++++++++---- > 1 file changed, 23 insertions(+), 4 deletions(-) > > diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2 > index 611a39b80..f58bfea8f 100644 > --- a/man2/copy_file_range.2 > +++ b/man2/copy_file_range.2 > @@ -169,6 +169,9 @@ Out of memory. > .B ENOSPC > There is not enough space on the target filesystem to complete the copy. > .TP > +.BR EOPNOTSUPP " (since Linux 5.12)" > +The filesystem does not support this operation. > +.TP > .B EOVERFLOW > The requested source or destination range is too large to represent in the > specified data types. > @@ -184,10 +187,17 @@ or > .I fd_out > refers to an active swap file. > .TP > -.B EXDEV > +.BR EXDEV " (before Linux 5.3)" > +The files referred to by > +.IR fd_in " and " fd_out > +are not on the same filesystem. > +.TP > +.BR EXDEV " (since Linux 5.12)" > The files referred to by > .IR fd_in " and " fd_out > -are not on the same mounted filesystem (pre Linux 5.3). > +are not on the same filesystem, > +and the source and target filesystems are not of the same type, > +or do not support cross-filesystem copy. > .SH VERSIONS > The > .BR copy_file_range () > @@ -200,8 +210,11 @@ Areas of the API that weren't clearly defined were clarified and the API bounds > are much more strictly checked than on earlier kernels. > Applications should target the behaviour and requirements of 5.3 kernels. > .PP > -First support for cross-filesystem copies was introduced in Linux 5.3. > -Older kernels will return -EXDEV when cross-filesystem copies are attempted. > +Since Linux 5.12, > +cross-filesystem copies can be achieved > +when both filesystems are of the same type, > +and that filesystem implements support for it. > +See BUGS for behavior prior to 5.12. > .SH CONFORMING TO > The > .BR copy_file_range () > @@ -226,6 +239,12 @@ gives filesystems an opportunity to implement "copy acceleration" techniques, > such as the use of reflinks (i.e., two or more inodes that share > pointers to the same copy-on-write disk blocks) > or server-side-copy (in the case of NFS). > +.SH BUGS > +In Linux kernels 5.3 to 5.11, > +cross-filesystem copies were implemented by the kernel, > +if the operation was not supported by individual filesystems. > +However, on some virtual filesystems, > +the call failed to copy, while still reporting success. ...success, or merely a short copy? (The rest looks reasonable (at least by c_f_r standards) to me.) --D > .SH EXAMPLES > .EX > #define _GNU_SOURCE > -- > 2.30.1.721.g45526154a5 >