From patchwork Thu Mar 4 09:38:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alejandro Colomar X-Patchwork-Id: 392778 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=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT 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 21163C4332D for ; Thu, 4 Mar 2021 09:42:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F33B864EE6 for ; Thu, 4 Mar 2021 09:42:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237762AbhCDJlT (ORCPT ); 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-Google-Smtp-Source: ABdhPJy5rhRh3oIwq+uQ7c2BFcomsa5X6e0OMtaarr4aRCxsiyv3xNoF5kJaWXKyZ+4A1ooWqFB6Uw== 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 Precedence: bulk List-ID: X-Mailing-List: ceph-devel@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