From unknown Tue Jun 17 20:42:11 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#60455 <60455@debbugs.gnu.org> To: bug#60455 <60455@debbugs.gnu.org> Subject: Status: Missing fallback if copy_file_range returns ENOENT? Reply-To: bug#60455 <60455@debbugs.gnu.org> Date: Wed, 18 Jun 2025 03:42:11 +0000 retitle 60455 Missing fallback if copy_file_range returns ENOENT? reassign 60455 coreutils submitter 60455 Sam James severity 60455 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 12:01:12 2022 Received: (at submit) by debbugs.gnu.org; 31 Dec 2022 17:01:12 +0000 Received: from localhost ([127.0.0.1]:39728 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBfEO-00082p-AU for submit@debbugs.gnu.org; Sat, 31 Dec 2022 12:01:12 -0500 Received: from lists.gnu.org ([209.51.188.17]:58408) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBfEM-00082h-5b for submit@debbugs.gnu.org; Sat, 31 Dec 2022 12:01:10 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pBfEL-0007Vs-Vf for bug-coreutils@gnu.org; Sat, 31 Dec 2022 12:01:10 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183] helo=smtp.gentoo.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1pBfEH-0000xw-B7 for bug-coreutils@gnu.org; Sat, 31 Dec 2022 12:01:09 -0500 From: Sam James Content-Type: multipart/signed; boundary="Apple-Mail=_37806F89-30F4-4656-AF28-B971FF75EAFA"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Missing fallback if copy_file_range returns ENOENT? Message-Id: Date: Sat, 31 Dec 2022 17:00:48 +0000 To: bug-coreutils@gnu.org X-Mailer: Apple Mail (2.3731.300.101.1.3) Received-SPF: pass client-ip=140.211.166.183; envelope-from=sam@gentoo.org; helo=smtp.gentoo.org X-Spam_score_int: -41 X-Spam_score: -4.2 X-Spam_bar: ---- X-Spam_report: (-4.2 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.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: -3.3 (---) --Apple-Mail=_37806F89-30F4-4656-AF28-B971FF75EAFA Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=us-ascii Hi folks, Originally reported in Gentoo at https://bugs.gentoo.org/885793. Frank Limpert reported that when copying large files across CIFS shares, cp may abort because copy_file_range returns ENOENT sometimes. This sounds like a suspicious kernel bug if CIFS interactions are = sometimes spuriously giving ENOENT, but I'm wondering if coreutils needs to do anything to handle this as well. strace output from his cp invocation: = https://bugs.gentoo.org/attachment.cgi?id=3D842497 Best, sam --Apple-Mail=_37806F89-30F4-4656-AF28-B971FF75EAFA Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY7BqwV8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kHOXAPoCo6MnpUxze8rR+aZ/8lSBLjvKHi+WRneTTYA/dDsliAD/e3cD2+oRyBBa 0YExNitFpIod27ZW6ywvWlfTgnJXAAg= =9tlj -----END PGP SIGNATURE----- --Apple-Mail=_37806F89-30F4-4656-AF28-B971FF75EAFA-- From debbugs-submit-bounces@debbugs.gnu.org Sat Dec 31 13:51:22 2022 Received: (at 60455) by debbugs.gnu.org; 31 Dec 2022 18:51:22 +0000 Received: from localhost ([127.0.0.1]:39828 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBgx0-0004kY-87 for submit@debbugs.gnu.org; Sat, 31 Dec 2022 13:51:22 -0500 Received: from mail-wm1-f45.google.com ([209.85.128.45]:35578) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pBgwy-0004kJ-2S for 60455@debbugs.gnu.org; Sat, 31 Dec 2022 13:51:20 -0500 Received: by mail-wm1-f45.google.com with SMTP id m8-20020a05600c3b0800b003d96f801c48so15596576wms.0 for <60455@debbugs.gnu.org>; Sat, 31 Dec 2022 10:51:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=sRThKBbY5z9xgBHBzR8brll4zUlxiNgzdFtrJ0RgmLM=; b=MRrHJ1zfpywdWYrOzRwiCSchPY+0QpQR1FqW2KxlURm3TB0Sh2yfpxmvo4WdAXpG+Q EHXAoaCz63K8sLuucuD8f5lYHm8hop7GSS0D05E+3F4HiY8lPqMHiotX+nEMXIXSJdel TZ1/ysNki1PJd7MB6fE2UTifYXz6p/pklxo9Vgm9Xx2Qn/l3I6NwNPvxgahqKqWYvwsO f8lBGt+7HatVUmbPBQcX0s8myA6lau/+phF7STszkDPQaEL+gyeGA8fRJLDwdjjADqsP 8hhIBz243QgqC/cvg+9SW9sCJXmcxegSZGPYFAtRUzJRB8TWETopd0nxtnFKodhPIa/G jTNQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=sRThKBbY5z9xgBHBzR8brll4zUlxiNgzdFtrJ0RgmLM=; b=oZtrbYzi1n++V1No4ZQBuTgh7/DjIMH0WyZ1iCtcjhjTRvAEmjSOp04vZpxc3Cr4Uu QKNgstHlSsSHZUsjJCMh2Rbh1g8OOZiGqKuCauPXLL/oqFzDc9JOtNRipd1tI7YIKGI6 uVGoG0Hg9YfH055r4oLsb3J+ufk5FI9NIIAFizetfKIM7TZn+XXrzW92AH2euvoIw/Br fbu4rzDP/U3XEU6L3MHMCwU3AEs8Tv2LliEligSL4MmvtwIQA/fV4OdrErOua5VrlUAr 3TFh60eT87AkVC1PRLK0Aly4WXOxFjvMrY23FAd/TRF3wdRgw6P3fwf7gwd2fPX5HMFM a1/g== X-Gm-Message-State: AFqh2koR4jXvpb3T85a3pumUU/XwUWbEj3rrkyw0ZoUflPx2w/MEwMAG IjaKhInJxG2orCuiCeM26eU= X-Google-Smtp-Source: AMrXdXv4DeujAFbWld2wvvtPs6Ay2ayFuiHlBn+0Zqx7FxjHOQ8R3xGFIoLBt6eiU/30bN8mg3va3g== X-Received: by 2002:a05:600c:3b93:b0:3d3:43ae:4d10 with SMTP id n19-20020a05600c3b9300b003d343ae4d10mr27152350wms.11.1672512673919; Sat, 31 Dec 2022 10:51:13 -0800 (PST) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id c12-20020a05600c0a4c00b003cfa3a12660sm52715592wmq.1.2022.12.31.10.51.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 31 Dec 2022 10:51:13 -0800 (PST) Message-ID: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> Date: Sat, 31 Dec 2022 18:51:12 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: bug#60455: Missing fallback if copy_file_range returns ENOENT? Content-Language: en-US To: Sam James , 60455@debbugs.gnu.org References: From: =?UTF-8?Q?P=c3=a1draig_Brady?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60455 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: -1.9 (-) On 31/12/2022 17:00, Sam James wrote: > Hi folks, > > Originally reported in Gentoo at https://bugs.gentoo.org/885793. > > Frank Limpert reported that when copying large files across CIFS shares, > cp may abort because copy_file_range returns ENOENT sometimes. > > This sounds like a suspicious kernel bug if CIFS interactions are sometimes > spuriously giving ENOENT, but I'm wondering if coreutils needs to do > anything to handle this as well. > > strace output from his cp invocation: https://bugs.gentoo.org/attachment.cgi?id=842497 We may be able to fallback, but it depends if the errno is possible to be returned at a partial copy or not. If partial then there is not much we can do. Now ENOENT is not a documented errno for copy_file_range() so I'm not sure what we should do with it. I didn't see on the bug above if any data was copied. Could we get more info about that? Searching for "cifs STATUS_OBJECT_NAME_NOT_FOUND" indicates we might be able to retry in this case: https://lists.samba.org/archive/samba/2017-September/211000.html I guess we could be defensive and also fstat(dest_fd) and fallback to standard copy if no data yet transferred. However note the above url is suggesting this error may not be specific to copy_file_range() and just an intermittent cifs thing. I.e. copy_file_range() is just a red herring here, and this just needs fixing in the kernel or server side setup. cheers, Pádraig From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 02:34:28 2023 Received: (at 60455) by debbugs.gnu.org; 7 Jan 2023 07:34:28 +0000 Received: from localhost ([127.0.0.1]:56361 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE3il-0006Tv-LL for submit@debbugs.gnu.org; Sat, 07 Jan 2023 02:34:27 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:43530 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pE3ik-0006Te-FC for 60455@debbugs.gnu.org; Sat, 07 Jan 2023 02:34:27 -0500 Content-Type: multipart/signed; boundary="Apple-Mail=_F409B144-DB93-40C3-BB6F-7817DC820402"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: bug#60455: Missing fallback if copy_file_range returns ENOENT? From: Sam James In-Reply-To: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> Date: Sat, 7 Jan 2023 07:34:06 +0000 Message-Id: References: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> To: =?utf-8?Q?P=C3=A1draig_Brady?= X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60455 Cc: 60455@debbugs.gnu.org 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: -3.3 (---) --Apple-Mail=_F409B144-DB93-40C3-BB6F-7817DC820402 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 31 Dec 2022, at 18:51, P=C3=A1draig Brady wrote: >=20 > On 31/12/2022 17:00, Sam James wrote: >> Hi folks, >> Originally reported in Gentoo at https://bugs.gentoo.org/885793. >> Frank Limpert reported that when copying large files across CIFS = shares, >> cp may abort because copy_file_range returns ENOENT sometimes. >> This sounds like a suspicious kernel bug if CIFS interactions are = sometimes >> spuriously giving ENOENT, but I'm wondering if coreutils needs to do >> anything to handle this as well. >> strace output from his cp invocation: = https://bugs.gentoo.org/attachment.cgi?id=3D842497 >=20 > We may be able to fallback, but it depends if the errno > is possible to be returned at a partial copy or not. > If partial then there is not much we can do. > Now ENOENT is not a documented errno for copy_file_range() > so I'm not sure what we should do with it. > I didn't see on the bug above if any data was copied. > Could we get more info about that? Frank got back to me and said an empty file gets created: ``` # cp /mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz = /mnt/OldBackup/EAV/1 cp: error copying '/mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz' = to '/mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz': No such = file or directory # stat /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz File: /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz Size: 0 Blocks: 8 IO Block: 1048576 regular empty file Device: 0,36 Inode: 81611419679 Links: 1 Access: (0664/-rw-rw-r--) Uid: ( 0/ root) Gid: ( 16/ cron) Access: 2023-01-06 21:45:57.070743000 +0100 Modify: 2023-01-06 21:45:57.070743000 +0100 Change: 2023-01-06 21:45:57.070743000 +0100 Birth: 2023-01-06 21:45:57.070743000 +0100 ``` --Apple-Mail=_F409B144-DB93-40C3-BB6F-7817DC820402 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY7kgbl8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kCy1AQDMWjNjJu7lFkGpY3r8yVqMLsmM7PT5g9cyMBBYn3l5jgD/YkDQCRmIR3zq BP7o4N9TySiI99lgZIDMy5WwUtKrngo= =flwK -----END PGP SIGNATURE----- --Apple-Mail=_F409B144-DB93-40C3-BB6F-7817DC820402-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 11:25:18 2023 Received: (at 60455) by debbugs.gnu.org; 7 Jan 2023 16:25:18 +0000 Received: from localhost ([127.0.0.1]:58799 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEC0U-00073t-1h for submit@debbugs.gnu.org; Sat, 07 Jan 2023 11:25:18 -0500 Received: from mail-wr1-f45.google.com ([209.85.221.45]:41647) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEC0R-00073e-CN for 60455@debbugs.gnu.org; Sat, 07 Jan 2023 11:25:16 -0500 Received: by mail-wr1-f45.google.com with SMTP id w1so3932222wrt.8 for <60455@debbugs.gnu.org>; Sat, 07 Jan 2023 08:25:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:sender:from:to:cc:subject :date:message-id:reply-to; bh=3x7jZZQzf9Ml03wmZVM49kGjuzXNsoRQsrbmTSVBtbk=; b=NPtQqZXSkkxbZJZAo1wEd8BglYZUncKups2agXyxwTNQRuS0WdwXGsuhys+sVnJJWt qDlRuckEac5kOxb/ZJBF9ZZgANxckBsbfxyYdbAbGgYtkdEjHFzXbnOmZb0zo24cpKa+ 4dYA++33tYh9YrW/XEO/eYq07tNYVGMSBDyjsW5z5IADj6N0KbLnvqUFh+Qzo26vZ6Ly h6r1XIvGjq/4Vxl8qq8MbsTdYAcXPY6Zr13cmQSsNYbyv9Kp7hfT85G4U4E/IcihQCBy 469G+nVNEaPsReCWADCgvdvf930MODWow4mNE2of5fMiipSNSpJhWcSZfvjECoG9j7Xl iOog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:sender:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=3x7jZZQzf9Ml03wmZVM49kGjuzXNsoRQsrbmTSVBtbk=; b=CouAPmzgkwsOYAFfdr7kIrReEUUhJuGNcBZQQ7XDV2Xs8R4pov6A8IXlX3jY5Oq488 iES69a3qbrSAGy0TL1OSKGnN/IbJRATJYLnTiyNK8VQYjcgPM+DGZ8kjUUUlo0r16MW1 sjNzpF+tU2wxYxRzn1EJ95X64FwCnd8thErkTkSfiNRQfYFNqvPlZDqyCpZSP7Qaea7A hbQVcZfMHKNS9hMgraWN5Fy83wbbl2cELbGhT0aczSfrLqhGzQDIHYm66NQXkcdfni/I +S979GpVcVrJ211eCFI+i5JLQ/deEdL8Z2RruUxBdaGVmYQNlrcRTzI6kAGr0+1dbon/ 65jQ== X-Gm-Message-State: AFqh2ko5PBIeETlL5/wyFx7d31OhM8n89vk1V6A3FbkTBCl6v4YVTAuc tQuuxfx9LKiVl8mZho+P91M= X-Google-Smtp-Source: AMrXdXtj/tDEQvOTqHRp9xx440uECU/x/GdQqlb7pIb+p5LPaSh8ju8lbe2NNp9m+rOfHwnvfDL6PQ== X-Received: by 2002:a05:6000:10a:b0:2bb:ddbc:649b with SMTP id o10-20020a056000010a00b002bbddbc649bmr270128wrx.57.1673108709173; Sat, 07 Jan 2023 08:25:09 -0800 (PST) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id z8-20020a5d6548000000b0028df2d57204sm4875092wrv.81.2023.01.07.08.25.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 07 Jan 2023 08:25:08 -0800 (PST) Content-Type: multipart/mixed; boundary="------------zLAho0eWAxR162o9PaylMP8i" Message-ID: <8c2a21c4-67aa-9847-8328-14abb5268571@draigBrady.com> Date: Sat, 7 Jan 2023 16:25:07 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: bug#60455: Missing fallback if copy_file_range returns ENOENT? Content-Language: en-US To: Sam James References: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> From: =?UTF-8?Q?P=c3=a1draig_Brady?= In-Reply-To: X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60455 Cc: 60455@debbugs.gnu.org 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: -1.9 (-) This is a multi-part message in MIME format. --------------zLAho0eWAxR162o9PaylMP8i Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 07/01/2023 07:34, Sam James wrote: > > >> On 31 Dec 2022, at 18:51, Pádraig Brady wrote: >> >> On 31/12/2022 17:00, Sam James wrote: >>> Hi folks, >>> Originally reported in Gentoo at https://bugs.gentoo.org/885793. >>> Frank Limpert reported that when copying large files across CIFS shares, >>> cp may abort because copy_file_range returns ENOENT sometimes. >>> This sounds like a suspicious kernel bug if CIFS interactions are sometimes >>> spuriously giving ENOENT, but I'm wondering if coreutils needs to do >>> anything to handle this as well. >>> strace output from his cp invocation: https://bugs.gentoo.org/attachment.cgi?id=842497 >> >> We may be able to fallback, but it depends if the errno >> is possible to be returned at a partial copy or not. >> If partial then there is not much we can do. >> Now ENOENT is not a documented errno for copy_file_range() >> so I'm not sure what we should do with it. >> I didn't see on the bug above if any data was copied. >> Could we get more info about that? > > Frank got back to me and said an empty file gets created: > ``` > # cp /mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz /mnt/OldBackup/EAV/1 > cp: error copying '/mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz' to '/mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz': No such file or directory > # stat /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz > File: /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz > Size: 0 Blocks: 8 IO Block: 1048576 regular empty file OK then it's probably worth handling in coreutils then. Note I still get the feeling this is a race in CIFS that is only being made more apparent with copy_file_range(), but fair enough that this is a regressions for users and we should be able to cater for it easy enough. The attached does that for ENOENT. cheers, Pádraig --------------zLAho0eWAxR162o9PaylMP8i Content-Type: text/x-patch; charset=UTF-8; name="copy-range-cifs.patch" Content-Disposition: attachment; filename="copy-range-cifs.patch" Content-Transfer-Encoding: base64 RnJvbSBkNGZmZTgxZTJiYjczOGEzMDRmNmQ2ZDY1ZWRkMWZhNGE1NjkyOWU4IE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiA9P1VURi04P3E/UD1DMz1BMWRyYWlnPTIwQnJhZHk/ PSA8UEBkcmFpZ0JyYWR5LmNvbT4KRGF0ZTogU2F0LCA3IEphbiAyMDIzIDE2OjEwOjAxICsw MDAwClN1YmplY3Q6IFtQQVRDSF0gY29weTogY29weV9maWxlX3JhbmdlOiBoYW5kbGUgRU5P RU5UIGZvciBDSUZTCgoqIHNyYy9jb3B5LmMgKHNwYXJzZV9jb3B5KTogRmFsbGJhY2sgdG8g c3RhbmRhcmQgY29weSB1cG9uIEVOT0VOVCwKd2hpY2ggd2FzIHNlZW4gaW50ZXJtaXR0ZW50 bHkgYWNyb3NzIENJRlMgZmlsZSBzeXN0ZW1zLgoqIE5FV1M6IE1lbnRpb24gdGhlIGJ1ZyBm aXguCkZpeGVzIGh0dHBzOi8vYnVncy5nbnUub3JnLzYwNDU1Ci0tLQogTkVXUyAgICAgICB8 IDQgKysrKwogc3JjL2NvcHkuYyB8IDUgKysrKysKIDIgZmlsZXMgY2hhbmdlZCwgOSBpbnNl cnRpb25zKCspCgpkaWZmIC0tZ2l0IGEvTkVXUyBiL05FV1MKaW5kZXggMzEwNWRmM2Y4Li41 Y2FlMTE5N2UgMTAwNjQ0Ci0tLSBhL05FV1MKKysrIGIvTkVXUwpAQCAtMjUsNiArMjUsMTAg QEAgR05VIGNvcmV1dGlscyBORVdTICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLSotIG91dGxpbmUgLSotCiAgIHdoaWNoIG1heSBoYXZlIHJlc3VsdGVkIGluIGRhdGEg Y29ycnVwdGlvbi4KICAgW2J1ZyBpbnRyb2R1Y2VkIGluIGNvcmV1dGlscy03LjUgYW5kIGVu YWJsZWQgYnkgZGVmYXVsdCBpbiBjb3JldXRpbHMtOS4wXQogCisgIGNwLCBtdiwgYW5kIGlu c3RhbGwgbm93IGhhbmRsZSBFTk9FTlQgZmFpbHVyZXMgYWNyb3NzIENJRlMgZmlsZSBzeXN0 ZW1zLAorICBmYWxsaW5nIGJhY2sgZnJvbSBjb3B5X2ZpbGVfcmFuZ2UgdG8gYSBiZXR0ZXIg c3VwcG9ydGVkIHN0YW5kYXJkIGNvcHkuCisgIFtidWcgaW50cm9kdWNlZCBpbiBjb3JldXRp bHMtOS4wXQorCiAgICdtdiAtLWJhY2t1cD1zaW1wbGUgZiBkLycgbm8gbG9uZ2VyIG1pc3Rh a2VubHkgYmFja3MgdXAgZC9mIHRvIGZ+LgogICBbYnVnIGludHJvZHVjZWQgaW4gY29yZXV0 aWxzLTkuMV0KIApkaWZmIC0tZ2l0IGEvc3JjL2NvcHkuYyBiL3NyYy9jb3B5LmMKaW5kZXgg NTE5YzQzYjAwLi45OGYyYmE0NWEgMTAwNjQ0Ci0tLSBhL3NyYy9jb3B5LmMKKysrIGIvc3Jj L2NvcHkuYwpAQCAtMjkwLDYgKzI5MCwxMSBAQCBzcGFyc2VfY29weSAoaW50IHNyY19mZCwg aW50IGRlc3RfZmQsIGNoYXIgKiphYnVmLCBzaXplX3QgYnVmX3NpemUsCiAgICAgICAgICAg ICBpZiAoZXJybm8gPT0gRVBFUk0gJiYgKnRvdGFsX25fcmVhZCA9PSAwKQogICAgICAgICAg ICAgICBicmVhazsKIAorICAgICAgICAgICAgLyogRU5PRU5UIHdhcyBzZWVuIHNvbWV0aW1l cyBhY3Jvc3MgQ0lGUyBzaGFyZXMsIHJlc3VsdGluZyBpbgorICAgICAgICAgICAgICAgbm8g ZGF0YSBiZWluZyBjb3BpZWQsIGJ1dCBzdWJzZXF1ZW50IHN0YW5kYXJkIGNvcGllcyBzdWNj ZWVkLiAgKi8KKyAgICAgICAgICAgIGlmIChlcnJubyA9PSBFTk9FTlQgJiYgKnRvdGFsX25f cmVhZCA9PSAwKQorICAgICAgICAgICAgICBicmVhazsKKwogICAgICAgICAgICAgaWYgKGVy cm5vID09IEVJTlRSKQogICAgICAgICAgICAgICBuX2NvcGllZCA9IDA7CiAgICAgICAgICAg ICBlbHNlCi0tIAoyLjI2LjIKCg== --------------zLAho0eWAxR162o9PaylMP8i-- From debbugs-submit-bounces@debbugs.gnu.org Sat Jan 07 19:52:19 2023 Received: (at 60455) by debbugs.gnu.org; 8 Jan 2023 00:52:19 +0000 Received: from localhost ([127.0.0.1]:59367 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJv9-0002c0-6V for submit@debbugs.gnu.org; Sat, 07 Jan 2023 19:52:19 -0500 Received: from woodpecker.gentoo.org ([140.211.166.183]:49894 helo=smtp.gentoo.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEJv5-0002bd-TO for 60455@debbugs.gnu.org; Sat, 07 Jan 2023 19:52:17 -0500 Content-Type: multipart/signed; boundary="Apple-Mail=_8CEB779E-A65C-43B7-8226-252095997923"; protocol="application/pgp-signature"; micalg=pgp-sha512 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.300.101.1.3\)) Subject: Re: bug#60455: Missing fallback if copy_file_range returns ENOENT? From: Sam James In-Reply-To: <8c2a21c4-67aa-9847-8328-14abb5268571@draigBrady.com> Date: Sun, 8 Jan 2023 00:51:55 +0000 Message-Id: <79241D6A-DBF0-46BC-B798-D31DDB81AC35@gentoo.org> References: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> <8c2a21c4-67aa-9847-8328-14abb5268571@draigBrady.com> To: =?utf-8?Q?P=C3=A1draig_Brady?= X-Mailer: Apple Mail (2.3731.300.101.1.3) X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 60455 Cc: 60455@debbugs.gnu.org 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: -3.3 (---) --Apple-Mail=_8CEB779E-A65C-43B7-8226-252095997923 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 > On 7 Jan 2023, at 16:25, P=C3=A1draig Brady wrote: >=20 > On 07/01/2023 07:34, Sam James wrote: >>> On 31 Dec 2022, at 18:51, P=C3=A1draig Brady = wrote: >>>=20 >>> On 31/12/2022 17:00, Sam James wrote: >>>> Hi folks, >>>> Originally reported in Gentoo at https://bugs.gentoo.org/885793. >>>> Frank Limpert reported that when copying large files across CIFS = shares, >>>> cp may abort because copy_file_range returns ENOENT sometimes. >>>> This sounds like a suspicious kernel bug if CIFS interactions are = sometimes >>>> spuriously giving ENOENT, but I'm wondering if coreutils needs to = do >>>> anything to handle this as well. >>>> strace output from his cp invocation: = https://bugs.gentoo.org/attachment.cgi?id=3D842497 >>>=20 >>> We may be able to fallback, but it depends if the errno >>> is possible to be returned at a partial copy or not. >>> If partial then there is not much we can do. >>> Now ENOENT is not a documented errno for copy_file_range() >>> so I'm not sure what we should do with it. >>> I didn't see on the bug above if any data was copied. >>> Could we get more info about that? >> Frank got back to me and said an empty file gets created: >> ``` >> # cp /mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz = /mnt/OldBackup/EAV/1 >> cp: error copying = '/mnt/Backup/EAV/data-eav-eav-aktiv-20221207.dump.xz' to = '/mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz': No such file = or directory >> # stat /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz >> File: /mnt/OldBackup/EAV/1/data-eav-eav-aktiv-20221207.dump.xz >> Size: 0 Blocks: 8 IO Block: 1048576 regular empty file >=20 > OK then it's probably worth handling in coreutils then. > Note I still get the feeling this is a race in CIFS > that is only being made more apparent with copy_file_range(), > but fair enough that this is a regressions for users and > we should be able to cater for it easy enough. Total agreement. Thanks, looks good! --Apple-Mail=_8CEB779E-A65C-43B7-8226-252095997923 Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=signature.asc Content-Type: application/pgp-signature; name=signature.asc Content-Description: Message signed with OpenPGP -----BEGIN PGP SIGNATURE----- iNUEARYKAH0WIQQlpruI3Zt2TGtVQcJzhAn1IN+RkAUCY7oTrF8UgAAAAAAuAChp c3N1ZXItZnByQG5vdGF0aW9ucy5vcGVucGdwLmZpZnRoaG9yc2VtYW4ubmV0MjVB NkJCODhERDlCNzY0QzZCNTU0MUMyNzM4NDA5RjUyMERGOTE5MAAKCRBzhAn1IN+R kL5KAPkBLEjtkUgViw9qTTmmLTkmhbTLApgl6iDPuRqviUNV3AEArnqN/qO+loCV b1ZC3PAENWHnG44ss7kv9DwZ18Txcg8= =pVbN -----END PGP SIGNATURE----- --Apple-Mail=_8CEB779E-A65C-43B7-8226-252095997923-- From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 08 08:45:56 2023 Received: (at 60455-done) by debbugs.gnu.org; 8 Jan 2023 13:45:56 +0000 Received: from localhost ([127.0.0.1]:60197 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEVzl-00037c-Oe for submit@debbugs.gnu.org; Sun, 08 Jan 2023 08:45:56 -0500 Received: from mail-wm1-f53.google.com ([209.85.128.53]:52754) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pEVzg-00037L-Eh for 60455-done@debbugs.gnu.org; Sun, 08 Jan 2023 08:45:52 -0500 Received: by mail-wm1-f53.google.com with SMTP id ay40so4416938wmb.2 for <60455-done@debbugs.gnu.org>; Sun, 08 Jan 2023 05:45:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Oi8MnnGU27O8dvIE8LywzidYPP8rqi8l80ySNFZVGHk=; b=gU2KcnKoEiS/qgAw4Z5UMyzumVF8EjhyeAhcMv2CT9GRKdSCOXnlyX3mGscDWaxw8Y 4FfDkwhbnpUlFPt0Hh3BXlfg15xcauM04qooNZhB1XJ+SsMCsAOYtrtMl6IBCyMcozTJ 79p71ynrIwfggH7MDGXP8GjnOMJ3jMldMffUR/w45xRzEsTg/r7tXPi/f1SfF3TcQIzZ 7GX4396RwaMvZXQiJGZYOHFn6Opcj1c/1KU6vxwecDEYAiUlUhoQEU5XYsg636blFJ/s egki8ZPElzpiRu+DpvtnoPk0pvD38RLJtHmZgVjjPz9WO4TkJzXmFw1PoV4S0+iZbuOU EXYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Oi8MnnGU27O8dvIE8LywzidYPP8rqi8l80ySNFZVGHk=; b=k9XyHZ0BFDiScoYxQVzBjw1yTgC3NX3Woc/q2/YAYciAlYqkzO2HCbkd27iu5pZjnw pehU9R5AkvbWVEkrWEowmlnfuzqIyQxhVulcsOT5ElrecygT7WIgj2vyBQvnW72pE4or BFYabW00u0LAMQs/Zz+AtQ0fuRv9vAr15kfPBfDvoCe3kLWQG0uS6DeTjNaMKdXzO2Af HLi412d7/yULr2Op6sSKa0QR7Ws6+3TJ7xYSvpdPFc0f3vdXPvIpN5ZHLdI6TFjLtxBt z3rV1N1e6M2rfAjGXdfBEwAkMeCjWSDdptZzPmfgoGhSjcBrD34N3qtnrPqqpTxtoYqf 77ug== X-Gm-Message-State: AFqh2kr75HtixSvNjM8w1ePzW5v+ArCuXCZLjPQe8AmPQ/gKRJUUDOOQ VX0JHDLE++I01ln5xfFDSvE= X-Google-Smtp-Source: AMrXdXveF0pUyAioL68aeKJN0Y1GKlIlR956mCQlI5ghDJMPfJCxqgtNeT+pylJ0xaOX01o9lUL0Xg== X-Received: by 2002:a05:600c:34c2:b0:3cf:7397:c768 with SMTP id d2-20020a05600c34c200b003cf7397c768mr43582407wmq.30.1673185542288; Sun, 08 Jan 2023 05:45:42 -0800 (PST) Received: from [192.168.1.9] (95-44-90-175-dynamic.agg2.lod.rsl-rtd.eircom.net. [95.44.90.175]) by smtp.googlemail.com with ESMTPSA id bg24-20020a05600c3c9800b003cfa3a12660sm24411078wmb.1.2023.01.08.05.45.41 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 08 Jan 2023 05:45:41 -0800 (PST) Message-ID: Date: Sun, 8 Jan 2023 13:45:40 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.0 Subject: Re: bug#60455: Missing fallback if copy_file_range returns ENOENT? Content-Language: en-US To: Sam James References: <322a2592-ec9a-136d-2a3d-b71ea5669369@draigBrady.com> <8c2a21c4-67aa-9847-8328-14abb5268571@draigBrady.com> <79241D6A-DBF0-46BC-B798-D31DDB81AC35@gentoo.org> From: =?UTF-8?Q?P=c3=a1draig_Brady?= In-Reply-To: <79241D6A-DBF0-46BC-B798-D31DDB81AC35@gentoo.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -0.9 (/) X-Debbugs-Envelope-To: 60455-done Cc: 60455-done@debbugs.gnu.org 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: -1.9 (-) On 08/01/2023 00:51, Sam James wrote: > > >> On 7 Jan 2023, at 16:25, Pádraig Brady wrote: >> OK it's probably worth handling in coreutils then. >> Note I still get the feeling this is a race in CIFS >> that is only being made more apparent with copy_file_range(), >> but fair enough that this is a regressions for users and >> we should be able to cater for it easy enough. Or more precisely, ENOENT will be unusual for fd operations, and so falling back to a standard copy should just be restricted to this or similar cases. If this was seen on a single CIFS mount it may be less appropriate as then the user may not want to fall back to a client side copy, when a server side should work. But in this separate mount case, the fallback is appropriate. I guess we could restrict to separate device IDs, but that's probably getting too complicated for this. > Total agreement. Thanks, looks good! Pushed. Marking this as done. cheers, Pádraig From unknown Tue Jun 17 20:42:11 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Mon, 06 Feb 2023 12:24:11 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator