Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp3309483pxb; Mon, 1 Mar 2021 07:00:02 -0800 (PST) X-Google-Smtp-Source: ABdhPJwQdjKph9dN9tNId2aHqjrwcsAc65JyL3Pl04B+RehAeoydxn5jOgnzIwvsVUnk3iDhjzPz X-Received: by 2002:a17:906:c09:: with SMTP id s9mr16177949ejf.539.1614610801882; Mon, 01 Mar 2021 07:00:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614610801; cv=none; d=google.com; s=arc-20160816; b=qA9iAlbOGAjN95/xsCAIFbWCV2/uVOwVPeSI60+Xr1Di6f1J8XyLNl+2r/PAYhZVl0 Z7ka6rKnLM3sapZtRr2LiCdIMsCtu8EAU6Tq3/8NIzBC7HqEnGRezsE3KPjG3/OTJ9k0 n6OJO8HyJqXtqKjhGVcuIXCr1pYHcM0SMiTOz4fmJ+efd1uPYzIvx3LG1/vuT8l1HAK4 uTyzLasbHD9+w7MkfYBS0gIfDKGbAi79RDYouEGmIym5BeUPWgeCX5kmupBlVLGrU6ff OqA4EI74oVDlCCkwDn126P1x+SeUwwYvcJoofJegjdfQY+w7wnWuj9llgkE0AgYT+KzQ buLw== 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=ZlENCPvxf7DjKyfZ7xMGkDQ8iQrc9BRxxJPj+woaL84=; b=qexTD2ZkR5SpbPIycnTS92EiHr61Zu68JNvSNCcMAItIAwDqH9wmjL1aurrrm2z7c2 Sv4XRetRpLs5AjeKcvmjtP4wfII05n6Rpxljf5rbl2HBFNhFe7ZpPpS4o+iis1H6bd3f Y6egbtzM4trXRteu7AETMaeuiMWxMgLtU/jxxOt8GjTydIfM0hFVUIcGlhMhv+98PP/M 6COUYe0kMqGeTpUM5DNVbExOfLUNZyGvh1yYZBJPsqIy63VwsxOnYmbaXihFJq49oZTH L0/RR+L0bXk175a1PAbM/lakcjZ/L8o7SIdbvFrra4EulZPicajj7D16SUOTdNqhZfBG WIrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=PboAFXfJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q3si11671532ejb.599.2021.03.01.06.59.38; Mon, 01 Mar 2021 07:00:01 -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=@gmail.com header.s=20161025 header.b=PboAFXfJ; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236712AbhCAO7B (ORCPT + 99 others); Mon, 1 Mar 2021 09:59:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45586 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236377AbhCAO67 (ORCPT ); Mon, 1 Mar 2021 09:58:59 -0500 Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5273C061756; Mon, 1 Mar 2021 06:58:18 -0800 (PST) Received: by mail-io1-xd36.google.com with SMTP id o11so10113954iob.1; Mon, 01 Mar 2021 06:58:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=ZlENCPvxf7DjKyfZ7xMGkDQ8iQrc9BRxxJPj+woaL84=; b=PboAFXfJuiBB/erCa7BBODs55QRuQHo6MhgsR2x1tHo/26H7gElGza013dhcsZd1Lp IMxSqWNrzGk/Q8unn9tteC0eK0JnnoeyuRQVBeYN2uofqpC5kcbuz5O3TJhAxbMPld5I emGwXGGoL8TTUdEDT3trWqZRTAM0zQi5QhUJusaPdUwFOOOeyJFJh0X8jrbt3pf6c3r9 H+9EqXWs5c7lKn6XgK37Z+PGqF3FN2JAmi37jH2xJBeSRT+gPWrPSb0K33/1ITjKERK3 Tgtj0IOJzes4HEOBAm661cXOqYYguCjdatJnQlyAn0peoAFk9joqW3PbYIvenKZ1jswg S8WA== 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=ZlENCPvxf7DjKyfZ7xMGkDQ8iQrc9BRxxJPj+woaL84=; b=YIK9lyqp+LmHYywR0zdw5uLgY9o7azHzTxmL9p9bKzRpbve31WDeluN9ATnKWp3xh2 T23FYd3wfjIiL+XjPzupZNJo9BfBYUhJo0nXGBZy4CcZsdhiPx3mBdNtR++1r4IdTkRF qnweQuvN/DL8muU3PkB3l7fn2Z3FhZ7CkIxexYz531kgin1UG7mf4jXxJe+M4LYpluJ8 rOvTRDM3NrM96d+sbDWb+XzglJSAI7GIe4BA1I88eN6F31AjJEDmpAL9W9RjmF1kHOm4 WUZTKtQJqjw8PngX/2il/Nt3ZtXqJ2p+4FZpMmyKclSoOw6H/oL2qIe1nPFk1V4ga+Oc 41Qw== X-Gm-Message-State: AOAM532FFvrS6mnwh3x2A6MVrpt+KLEMS2F8UxpkQU/tUXbkyGcCE8pm z/Rimt4rHgS8nKQ7I4HR7Pms6ZpBx5RIcomT6Fs= X-Received: by 2002:a05:6602:2c52:: with SMTP id x18mr14201484iov.5.1614610698219; Mon, 01 Mar 2021 06:58:18 -0800 (PST) MIME-Version: 1.0 References: <20210224142307.7284-1-lhenriques@suse.de> <20210301144104.75545-1-alx.manpages@gmail.com> In-Reply-To: <20210301144104.75545-1-alx.manpages@gmail.com> From: Amir Goldstein Date: Mon, 1 Mar 2021 16:58:07 +0200 Message-ID: Subject: Re: [RFC v3] copy_file_range.2: Update cross-filesystem support for 5.12 To: Alejandro Colomar Cc: linux-man , 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 Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Mon, Mar 1, 2021 at 4:45 PM 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. > > --- > Hi Amir, > > I covered your comments. I may need to add something else after your > discussion with Steve; please comment. > > I tried to reword BUGS so that it's as specific and understandable as I can. > If you still find it not good enough, please comment :) > > Thanks, > > Alex > > --- > man2/copy_file_range.2 | 26 ++++++++++++++++++++++---- > 1 file changed, 22 insertions(+), 4 deletions(-) > > diff --git a/man2/copy_file_range.2 b/man2/copy_file_range.2 > index 611a39b80..1c0df3f74 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,10 @@ 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 5.12, > +cross-filesystem copies can be achieved > +when both filesystems are of the same type, > +and that filesystem implements support for it. Maybe refer to BUGS here for pre 5.12 behavior? > .SH CONFORMING TO > The > .BR copy_file_range () > @@ -226,6 +238,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 supported by the kernel, > +instead of being supported by individual filesystems. Not so clear/accurate IMO. Maybe: 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. Thanks, Amir.