From unknown Tue Jun 17 01:43:34 2025 X-Loop: help-debbugs@gnu.org Subject: bug#48164: cp --reflink=never no longer works as expected Resent-From: Chris Murphy Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Sun, 02 May 2021 17:13:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 48164 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 48164@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.161997557619654 (code B ref -1); Sun, 02 May 2021 17:13:01 +0000 Received: (at submit) by debbugs.gnu.org; 2 May 2021 17:12:56 +0000 Received: from localhost ([127.0.0.1]:43782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFeK-00056w-4l for submit@debbugs.gnu.org; Sun, 02 May 2021 13:12:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:34220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFeF-00056p-DM for submit@debbugs.gnu.org; Sun, 02 May 2021 13:12:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldFeE-0000jd-Vg for bug-coreutils@gnu.org; Sun, 02 May 2021 13:12:51 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldFeA-0001Hh-4A for bug-coreutils@gnu.org; Sun, 02 May 2021 13:12:47 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 4-20020a05600c26c4b0290146e1feccd8so2174754wmv.1 for ; Sun, 02 May 2021 10:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colorremedies-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=VtDmwufKWxiD+WwrqJI5GTUFqgBThZ5QPKmZaLTDHkY=; b=0c/TNHp3roHDedIbFDYVwFr1MLUKCGE3PRxHPq/7QDw4cydDefK0qOrtNA+zz5KS48 xreyfPDyxHu2CO7Pc2VmRj/yBJRhkOFh17gj/aqGzliJhLH7thM8F8jBcUUSC0uCosNg lhy78s37XeTsPNM3pq73XJzU8c3iXCG5Kq1K5nSHwBMMbMIbp6q5FFGFGt74WdmfUjDi 1Thk3Hqd0AbDbQtcd4fHwQFbufYKD2bnYYh0Xaczt5pnTIspEe6Y5aNrOHM9NxtdbeDq FXmKWc839bRw6f9zooQnhukI5FAHZuF/opGyn5WWFUSqevyxEL1+YYOVcc3CjvjOTujH ThvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VtDmwufKWxiD+WwrqJI5GTUFqgBThZ5QPKmZaLTDHkY=; b=pEMY2fh9wgsyF374wwpSMwuPkAwfgfP+z9Igx9VeWW5T34dVJv1sFohrWVXTE8e8m8 a/UR0jgkpu3YhcZJQqzsYiMX19INt1LpFy2lee51jYLFFkbaL229Md6vbsUzzDi7+d2f 7gGEu4iaD6ei4C+yVSMvvsyJ0JHJoRmgDdZ2Jf+vzs6FfwADtXux5CPkeKX0n7WwEkP7 +hgFtcsrmMAEzejE+yQ8TDlYT48M8gKrrbE61XnzbQzpfoHkz6em/3FDA2XSgZgPORvp esEmm7n/UhNUkhB3CL5xNV/yJzAsP0H3gUOK2xXO5XGXXSLGFEBwe0cUPsRqyWqx9VAV SIew== X-Gm-Message-State: AOAM5301I+Ly1O/Ihfp4h34od8h3TzcsUGT0iBSQvijx8VuD0kEkZrw/ YBwIVhSttYDqs4k5AbksG23Cz0Ieesg8Hhm5B+g6Gja9aOeXGq9h X-Google-Smtp-Source: ABdhPJz4nMxWoibot+LlSqLv47GhhrHgw1WyOhGaL/nYPG7xLczAYBNC5IlesSsMhx8ztHUtzfzr6/5juWniHP6OX94= X-Received: by 2002:a7b:c18b:: with SMTP id y11mr17367009wmi.11.1619975563806; Sun, 02 May 2021 10:12:43 -0700 (PDT) MIME-Version: 1.0 From: Chris Murphy Date: Sun, 2 May 2021 11:12:27 -0600 Message-ID: Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=chris@colorremedies.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Fedora 34 user 'adrum' reports that 'cp --reflink=never' is performing a lightweight copy on Btrfs. And filefrag -v shows the extents are shared. Strace shows use of copy_file_range even with --reflink=never The note for copy_file_range() includes: copy_file_range() gives filesystems an opportunity to implement "copy acceleration" techniques, such as the use of reflinks Downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1956080 The commit that causes the change in behavior: https://src.fedoraproject.org/rpms/coreutils/c/1737e5c81fa82451b510f982499bdedb2a1619d1?branch=rawhide It references five upstream commits. -- Chris Murphy From unknown Tue Jun 17 01:43:34 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Chris Murphy Subject: bug#48164: closed (Re: bug#48164: cp --reflink=never no longer works as expected) Message-ID: References: X-Gnu-PR-Message: they-closed 48164 X-Gnu-PR-Package: coreutils Reply-To: 48164@debbugs.gnu.org Date: Sun, 02 May 2021 21:00:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1619989202-2835-1" This is a multi-part message in MIME format... ------------=_1619989202-2835-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #48164: cp --reflink=3Dnever no longer works as expected which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 48164@debbugs.gnu.org. --=20 48164: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D48164 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1619989202-2835-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 48164-done) by debbugs.gnu.org; 2 May 2021 20:59:32 +0000 Received: from localhost ([127.0.0.1]:44696 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldJBb-0000j9-Px for submit@debbugs.gnu.org; Sun, 02 May 2021 16:59:32 -0400 Received: from mail-wr1-f46.google.com ([209.85.221.46]:41909) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldJBZ-0000j3-Be for 48164-done@debbugs.gnu.org; Sun, 02 May 2021 16:59:30 -0400 Received: by mail-wr1-f46.google.com with SMTP id d11so3514665wrw.8 for <48164-done@debbugs.gnu.org>; Sun, 02 May 2021 13:59:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=A0qV/IteouEBacNZ1aVcijAVL6jGY1ufozZreYLDshU=; b=gsaPAEZaJxacvY23J7ClFYidSHIxUuIrmTDJ47at1ZFlkuf2K9kii0WiKApefF6/k2 4eqZ2WKOwlMYTzTqtqUvQSdX0kjpzdJIvx7gFC7cB1g/oo7kJ/Wn2rl0T+96IS5SFHjH 5NJuRARBs49xRlV2DUXBMjCZFEXH0WWYTwCWSt3AKP02EALHsCOiQIZ6BJuLiu6UWCe3 JrHma5qmcmf0Y7yAyFMHY4NLpBgQ5RnVmeJ86ZOxd3mIJfYVIDysvbOx0V7PjvCaxhg8 uLri22rDSFtUXp057htCQkoc0MFAtMYrz9u8pAOhxY97ydHXm8Se5dQCu/cRrEpSJJQb zG1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=A0qV/IteouEBacNZ1aVcijAVL6jGY1ufozZreYLDshU=; b=pnGFl+wXzix274PRt2tny8ytuJezEI13+hcUqLPemL9DETIDs6VF/uFUGZDvnZbhpt f49gRtKAsar9+Gz9iXbqDJoLmkEPDeJeVqkhO4Be0Bx+LiaMio63/JKexPDpmm5fca6H GEcdItoE17PDPO1YFfAx8EEmIADfNe12POv4xevmCsoFzYTJwOf6izpJuakp/5uwRX2x rE+LKge0KUdu4+1+KEdAe8e+JNg+juLYKk74wPpgkdROzzTt0jpFJNM1FPKb+jhDIz/W HAFPzxkCUlnPozlKBiLudxTme2RKKosrp2mnaDeGvP/qyYMZ7yWnWCkyxCslYD8wYJNK SqIA== X-Gm-Message-State: AOAM530HCGQJ+mGVrQ5TqnOiDAwwOjl0qXTy3cUPXrqpyVOfFtpl9+I/ h5h7E40vXJlyuI0W9rTtCikxP0L5zFA= X-Google-Smtp-Source: ABdhPJyUaULXrlrbeJXRqGeCRqkGhG/1A3dBONogfIrZyKQiUIHF8bFGsl+mT/OnxN5m+S99YWceyg== X-Received: by 2002:a5d:6d85:: with SMTP id l5mr20481938wrs.22.1619989163294; Sun, 02 May 2021 13:59:23 -0700 (PDT) Received: from localhost.localdomain (86-42-14-227-dynamic.agg2.lod.rsl-rtd.eircom.net. [86.42.14.227]) by smtp.googlemail.com with UTF8SMTPSA id o13sm9932089wrf.91.2021.05.02.13.59.21 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 02 May 2021 13:59:22 -0700 (PDT) Subject: Re: bug#48164: cp --reflink=never no longer works as expected To: Chris Murphy , 48164-done@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= Message-ID: Date: Sun, 2 May 2021 21:59:21 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:84.0) Gecko/20100101 Thunderbird/84.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.5 (/) X-Debbugs-Envelope-To: 48164-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.5 (/) On 02/05/2021 18:12, Chris Murphy wrote: > Hi, > > Fedora 34 user 'adrum' reports that 'cp --reflink=never' is performing > a lightweight copy on Btrfs. And filefrag -v shows the extents are > shared. Strace shows use of copy_file_range even with --reflink=never > > The note for copy_file_range() includes: > > copy_file_range() gives filesystems an opportunity to implement > "copy acceleration" techniques, such as the use of reflinks > > > Downstream bug > https://bugzilla.redhat.com/show_bug.cgi?id=1956080 > > The commit that causes the change in behavior: > https://src.fedoraproject.org/rpms/coreutils/c/1737e5c81fa82451b510f982499bdedb2a1619d1?branch=rawhide > > It references five upstream commits. Thanks for the detailed report. I've fixed this upstream with: https://git.sv.gnu.org/gitweb/?p=coreutils.git;a=commitdiff;h=v8.32-147-gea9af9923 Ideally copy_file_range() would take CAN_REFLINK as a flag, but for now the patch above avoids the call with --reflink=never. Note we've not released an official coreutils release with this change yet, as we've yet to fully test all variations of this new copying logic. There are subtle interactions like this that need to be considered. BTW there has been recent discussions on the non generality of copy_file_range() at https://lwn.net/Articles/846403/ Marking this as done. cheers, Pádraig ------------=_1619989202-2835-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 2 May 2021 17:12:56 +0000 Received: from localhost ([127.0.0.1]:43782 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFeK-00056w-4l for submit@debbugs.gnu.org; Sun, 02 May 2021 13:12:56 -0400 Received: from lists.gnu.org ([209.51.188.17]:34220) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ldFeF-00056p-DM for submit@debbugs.gnu.org; Sun, 02 May 2021 13:12:54 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44016) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ldFeE-0000jd-Vg for bug-coreutils@gnu.org; Sun, 02 May 2021 13:12:51 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:42599) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ldFeA-0001Hh-4A for bug-coreutils@gnu.org; Sun, 02 May 2021 13:12:47 -0400 Received: by mail-wm1-x32e.google.com with SMTP id 4-20020a05600c26c4b0290146e1feccd8so2174754wmv.1 for ; Sun, 02 May 2021 10:12:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=colorremedies-com.20150623.gappssmtp.com; s=20150623; h=mime-version:from:date:message-id:subject:to; bh=VtDmwufKWxiD+WwrqJI5GTUFqgBThZ5QPKmZaLTDHkY=; b=0c/TNHp3roHDedIbFDYVwFr1MLUKCGE3PRxHPq/7QDw4cydDefK0qOrtNA+zz5KS48 xreyfPDyxHu2CO7Pc2VmRj/yBJRhkOFh17gj/aqGzliJhLH7thM8F8jBcUUSC0uCosNg lhy78s37XeTsPNM3pq73XJzU8c3iXCG5Kq1K5nSHwBMMbMIbp6q5FFGFGt74WdmfUjDi 1Thk3Hqd0AbDbQtcd4fHwQFbufYKD2bnYYh0Xaczt5pnTIspEe6Y5aNrOHM9NxtdbeDq FXmKWc839bRw6f9zooQnhukI5FAHZuF/opGyn5WWFUSqevyxEL1+YYOVcc3CjvjOTujH ThvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=VtDmwufKWxiD+WwrqJI5GTUFqgBThZ5QPKmZaLTDHkY=; b=pEMY2fh9wgsyF374wwpSMwuPkAwfgfP+z9Igx9VeWW5T34dVJv1sFohrWVXTE8e8m8 a/UR0jgkpu3YhcZJQqzsYiMX19INt1LpFy2lee51jYLFFkbaL229Md6vbsUzzDi7+d2f 7gGEu4iaD6ei4C+yVSMvvsyJ0JHJoRmgDdZ2Jf+vzs6FfwADtXux5CPkeKX0n7WwEkP7 +hgFtcsrmMAEzejE+yQ8TDlYT48M8gKrrbE61XnzbQzpfoHkz6em/3FDA2XSgZgPORvp esEmm7n/UhNUkhB3CL5xNV/yJzAsP0H3gUOK2xXO5XGXXSLGFEBwe0cUPsRqyWqx9VAV SIew== X-Gm-Message-State: AOAM5301I+Ly1O/Ihfp4h34od8h3TzcsUGT0iBSQvijx8VuD0kEkZrw/ YBwIVhSttYDqs4k5AbksG23Cz0Ieesg8Hhm5B+g6Gja9aOeXGq9h X-Google-Smtp-Source: ABdhPJz4nMxWoibot+LlSqLv47GhhrHgw1WyOhGaL/nYPG7xLczAYBNC5IlesSsMhx8ztHUtzfzr6/5juWniHP6OX94= X-Received: by 2002:a7b:c18b:: with SMTP id y11mr17367009wmi.11.1619975563806; Sun, 02 May 2021 10:12:43 -0700 (PDT) MIME-Version: 1.0 From: Chris Murphy Date: Sun, 2 May 2021 11:12:27 -0600 Message-ID: Subject: cp --reflink=never no longer works as expected To: bug-coreutils@gnu.org Content-Type: text/plain; charset="UTF-8" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=chris@colorremedies.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -1.3 (-) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Hi, Fedora 34 user 'adrum' reports that 'cp --reflink=never' is performing a lightweight copy on Btrfs. And filefrag -v shows the extents are shared. Strace shows use of copy_file_range even with --reflink=never The note for copy_file_range() includes: copy_file_range() gives filesystems an opportunity to implement "copy acceleration" techniques, such as the use of reflinks Downstream bug https://bugzilla.redhat.com/show_bug.cgi?id=1956080 The commit that causes the change in behavior: https://src.fedoraproject.org/rpms/coreutils/c/1737e5c81fa82451b510f982499bdedb2a1619d1?branch=rawhide It references five upstream commits. -- Chris Murphy ------------=_1619989202-2835-1--