Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1296653pxb; Thu, 4 Mar 2021 08:00:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJywPYNh6Z7FaBbYyeZmgoZftXVJfxYL2n8zxcbxdTxANYpJ3ysNMlVqyshv66jzkk1FQWte X-Received: by 2002:a05:6402:17d5:: with SMTP id s21mr5085170edy.65.1614873653579; Thu, 04 Mar 2021 08:00:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614873653; cv=none; d=google.com; s=arc-20160816; b=LNYOAUrORVhgNT2JUBjmcnfXxb/jO5IZCNrydr3ghXbuQig/TAWcOoyhATwM8fnZHj ytlbCS664O1Sn/RWHDISx5nf3GC7eYBNmyRc8aL6WdSwICX479FuHX0tiCVQan4ll3v+ Tne8sYO+r80mYKAcXjWNpC+1hA1vwCla6FZQ8sq7vj2NRkwrU0Tx2n+ee2SqHQBSYIxy 8tEchLljp6OEOj0H/mUU+EhKOADOKR6WDU3pckqWtbJ3w6fQ3ubGqyd2qRtPF9Qw6in9 mn1MYHFjoeYrjSJaKevPuOUtyhFgli8mYOyo2nbltuZnlRk8axGApMY2g728grcMkU4K ELGA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=O9B1qRNEkgiYM5e4Rnx0MUxTJfW3B+WFA4nF4a8IG1Q=; b=PhOsYvMq7c0RLhutuCxSeSd+jDBvepPWs3hV5gOaAV/ySQ3luLfmYBT0jJTiAuLSLJ DEtXDQuzNZkVaIwHHf9fI2tSjhsnzKAImQ4BuowAjOFtRw8xWmR8J2qi+WJ0xsXsSFVj rKa0Vn9dhO/ZJq7qkqXWxIzN5/rVNcTl9qXCBUsCKBoipL0uyYK4FDVjOyO+KvVS6b9O MAk/HoQzdVifABGrPxir9pnXrikL21Obv3695mOCi13kX/p9AvthCPVKh2zQg1ri5Q0A x6n5Dq37SNejzg81HvskK750dmyqqe0tF1IK2vQhntqWihAxEPkWsNhvc6FrDYl+sfy9 MbZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=kqVtZTrb; 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 zh8si16526573ejb.419.2021.03.04.08.00.20; Thu, 04 Mar 2021 08:00:53 -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=kqVtZTrb; 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 S237727AbhCDJlT (ORCPT + 99 others); Thu, 4 Mar 2021 04:41:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237792AbhCDJlA (ORCPT ); Thu, 4 Mar 2021 04:41:00 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0431DC061574; Thu, 4 Mar 2021 01:40:20 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id b18so20376314wrn.6; Thu, 04 Mar 2021 01:40:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=O9B1qRNEkgiYM5e4Rnx0MUxTJfW3B+WFA4nF4a8IG1Q=; b=kqVtZTrb2w1p+loQqs+tswteQ6Z300X2ogL0nfpDZwRrJloEuka6Qw3vbUznk9C/mP vAc+7/i3tCgseKniKiFZ1FEGT5USitOdaHx8q+dlr9Gp0Botig2yuooK/Ga3uM5o7uSW qpU9D7pKZrXxLKa8M9REIDyLjIJZ37+CRU8kz8lRGssHKNu7J2k1uG8GF4xO80RZDvhr fbYoyaFU+22zZHyXCX88e/XZW0Y/TjXyh8wWm0ch3ylVn8cabBUR9rXuPQEzViDMDg7d kQZB2RWb34DjYLTMuQCoJ/iHGnUvORj8TL3mM06a4mhPCETW0ncNxqQ5seEmMo4C2CGA DTpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=O9B1qRNEkgiYM5e4Rnx0MUxTJfW3B+WFA4nF4a8IG1Q=; b=T3HVI2d+hszN9lVlEVDupyluYALtUu7ihUfzjwD+x3XXHFn4gpBvpCW7u5Xp84FmyN 36QK0H2aP5ITOljw8/zpdzx/gGUTma5yOxdTUkl/yb/tG4j6FnC4H0HuB7zXjIzKdkSY gNryaruLatfPTZF5XwL4ztx3UqcRVS3vAT/m77dZ3eIvCGFA46ZA5vfv6zDbcIb3A3q9 eSPN+KOtVKbZt3+AbOyGlqWc73NLd3UI8Yp765pVTnb/bvEzi8VEjwiaqCyddlpDzPKq liv6tmoRtqYLTjPOAmiruSpKCCbc1Kot5nlS7M3Rmp75KjVJToz/teFANAJ3ygkFPeOz 6YxQ== X-Gm-Message-State: AOAM531Uo60oam7pmhGi/X9Qvyv8MslIihtOTu4yvPnsxy4oSg/XJqE4 eQtRq2FJb4GKwoMFGIeTinX9mhDhQKcz/Q== X-Received: by 2002:adf:a219:: with SMTP id p25mr3049987wra.400.1614850818747; Thu, 04 Mar 2021 01:40:18 -0800 (PST) Received: from localhost.localdomain ([170.253.51.130]) by smtp.googlemail.com with ESMTPSA id l2sm6127295wml.38.2021.03.04.01.40.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 Mar 2021 01:40:18 -0800 (PST) From: Alejandro Colomar To: linux-man@vger.kernel.org, Amir Goldstein , Michael Kerrisk , Luis Henriques , Steve French Cc: Alejandro Colomar , 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: [RFC v4] copy_file_range.2: Update cross-filesystem support for 5.12 Date: Thu, 4 Mar 2021 10:38:07 +0100 Message-Id: <20210304093806.10589-1-alx.manpages@gmail.com> X-Mailer: git-send-email 2.30.1.721.g45526154a5 In-Reply-To: <20210224142307.7284-1-lhenriques@suse.de> References: <20210224142307.7284-1-lhenriques@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org 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. .SH EXAMPLES .EX #define _GNU_SOURCE -- 2.30.1.721.g45526154a5