Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp2143793pxj; Sun, 9 May 2021 17:03:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzk6qvDR9k+lHkIV1HLtn0ufwTjk+xfqHjMLgs88IAyu9Ix3raWp2yr6SsO+zZo7DUluh4U X-Received: by 2002:a92:d7c4:: with SMTP id g4mr17736019ilq.224.1620605013818; Sun, 09 May 2021 17:03:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620605013; cv=none; d=google.com; s=arc-20160816; b=lvTthjJunHHctkA1ToaAzETwpeAw5aZ+/oonddenO34s+1nL9OYJ92yKaAB+pythum LCSbgRPjXk62ZTqNTrwiIvU1X9cXcvPq6/q9ZahivSQy1UGrgsKq/DjbA5X+HHocfqHa lodvsaY2Wm2fS/z/zZmHoobx4rfmKsYTFx5K3D5mOJoXMllhzBnzUV+wknsIIv3fRWG3 nxbWKLhXV9Oh3Eb3pQ6SBbNMp1eKN9zCLbz/dECKNnHd2ARAYl6+gO+vWrLNeOqIwjKP Nz0qY9HsPUh62DyIIK/GcpB6ulaPac5q2vjXCrH9s3C4yUSybtVfvOZspKSrdgm9ZGyu ULMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :to:subject:cc:dkim-signature; bh=RCbsF0rsHchNF4Z47MfeXnkE48Z3YPKTAxzeoF4KGWI=; b=s1SIAc0L1zlZKsSyaQ7EZRTI9+P6bQQGbfo1erxihoNoxJCWkJYCptOLBE1MMpECtS p5NTGsfAe5CZuMdJk0ylot97TfGVLbu56m/JVChe5c0+3500+kBgrvcwzZRJb4h15lyG lk51uQmT11l/ulzAKGtuiuBjIwoQf2VR4meii61FjmOdDDWBmifpUTTsM4MjQag0+Ara qyc3lQdFYcZdAs7E7F3pjKI0fwAUvUQ6Awl5FaBsm1JqXvxyDpnNeX8iO/n3Mc6YLQRZ vNSYlNIPhT8Aiy7X2vuh4bvHjy8Q4EZ0F+0DfTMUq4EBRfNLgV9V+wNMnEonWMSljECI Lyiw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=F6s38GpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 y5si12637119ill.127.2021.05.09.17.03.21; Sun, 09 May 2021 17:03:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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=F6s38GpE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-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 S230047AbhEJACg (ORCPT + 99 others); Sun, 9 May 2021 20:02:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41120 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229853AbhEJACg (ORCPT ); Sun, 9 May 2021 20:02:36 -0400 Received: from mail-pj1-x102b.google.com (mail-pj1-x102b.google.com [IPv6:2607:f8b0:4864:20::102b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8BFE3C061573; Sun, 9 May 2021 17:01:32 -0700 (PDT) Received: by mail-pj1-x102b.google.com with SMTP id j6-20020a17090adc86b02900cbfe6f2c96so9237924pjv.1; Sun, 09 May 2021 17:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=cc:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=RCbsF0rsHchNF4Z47MfeXnkE48Z3YPKTAxzeoF4KGWI=; b=F6s38GpEolJEV6UGVlzsKCgWD0v7DhR4sgKU1BhtB9dZRsJfeiuzHIYDSDqVjBhGWW eTjRswb2/t70afCmqzQchfJgpGjsypQFx60HAnuxQjG0VGYM4egd6wAg6tHSvNqcI07X xtlTL6QGfRdixmDBFIFjA7mAnxbJOuHHs+N00SSK6cy0xUAT5kSDySd/bwyTQxkZM++9 a7I2xMkt97CpFjXZDrPvZIZooVnNPfFiJ7qP6DBBeHdJLw+kRHHRHSK8O72YnQ6xwYC0 fUdGPnvW4O/aocrYuKf3LmyAwJAtu3OCvOhCBiU+VA4h8yklvgmWOQOZbM3LnfNRA2PI 0qFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:cc:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=RCbsF0rsHchNF4Z47MfeXnkE48Z3YPKTAxzeoF4KGWI=; b=RAy7B7sl2rLIPviusVgn/XiorCCllLWcXTWpjPCvaiBcBZoTZuUkj8ac3W3UTlQMW3 y9whGHgveE/wasP/w2EYmh1c0duHPHBh9yDZz80ytrdKYxdbnny4mr88PnE8gi91ipVk uvngniPn192LHxDawqIxQMvHb5Q6gTBk5CAdb5YupjZ+APRMWfh293GfvO/6S+NE7PvU EXbjfGAoc2Qvycf1hl2kygIDMGc/xYruA8ShPzgyUdrW69F8L0dFAHucKB51YsuBcxOL yhW7T+Hnxl1oqdU19uOEeJguAYOy7v8q2bMmx7/XbjTgQinB8YDZp0cusrDWLJlgZf5f h5HA== X-Gm-Message-State: AOAM532qR1sccScM4L9VJtbvx6Xjd2VFJZfzbM4M/wOaAG6ApqkfxXHF F5iVdvxoB3NU6Joxj9oiyD4= X-Received: by 2002:a17:90a:a384:: with SMTP id x4mr24408383pjp.201.1620604891941; Sun, 09 May 2021 17:01:31 -0700 (PDT) Received: from [192.168.192.21] (47-72-82-130.dsl.dyn.ihug.co.nz. [47.72.82.130]) by smtp.gmail.com with ESMTPSA id q24sm9334079pgb.19.2021.05.09.17.01.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 09 May 2021 17:01:31 -0700 (PDT) Cc: mtk.manpages@gmail.com, linux-man@vger.kernel.org, Luis Henriques , Amir Goldstein , Greg KH , Anna Schumaker , Jeff Layton , Steve French , 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: [PATCH] copy_file_range.2: Update cross-filesystem support for 5.12 To: Alejandro Colomar References: <20210509213930.94120-1-alx.manpages@gmail.com> <20210509213930.94120-12-alx.manpages@gmail.com> From: "Michael Kerrisk (man-pages)" Message-ID: Date: Mon, 10 May 2021 12:01:20 +1200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: <20210509213930.94120-12-alx.manpages@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alex, On 5/10/21 9:39 AM, 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. Thanks. Patch applied. Cheers, Michael > > 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 > --- > 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 467a16300..843e02241 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. > .SH EXAMPLES > .EX > #define _GNU_SOURCE > -- Michael Kerrisk Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/ Linux/UNIX System Programming Training: http://man7.org/training/