GNU bug report logs - #56391
`cp --reflink=always` creates empty file on failure

Previous Next

Package: coreutils;

Reported by: Benjamin Gilbert <bgilbert <at> backtick.net>

Date: Tue, 5 Jul 2022 08:16:01 UTC

Severity: normal

Merged with 56392

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Benjamin Gilbert <bgilbert <at> backtick.net>
Subject: bug#56392: closed (Re: bug#56391: `cp --reflink=always` creates
 empty file on failure)
Date: Tue, 05 Jul 2022 15:05:03 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#56391: `cp --reflink=always` creates empty file on failure

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 56392 <at> debbugs.gnu.org.

-- 
56391: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=56391
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Benjamin Gilbert <bgilbert <at> backtick.net>
Cc: 56391-done <at> debbugs.gnu.org
Subject: Re: bug#56391: `cp --reflink=always` creates empty file on failure
Date: Tue, 5 Jul 2022 10:04:48 -0500
[Message part 3 (text/plain, inline)]
Thanks for reporting that. I installed the attached patch.
[0001-cp-don-t-create-empty-file-if-cannot-clone.patch (text/x-patch, attachment)]
[Message part 5 (message/rfc822, inline)]
From: Benjamin Gilbert <bgilbert <at> backtick.net>
To: bug-coreutils <at> gnu.org
Subject: `cp --reflink=always` creates empty file on failure
Date: Tue, 5 Jul 2022 03:41:29 -0400
Hi,

When `cp --reflink=always` fails because the filesystem does not
support reflinks, I'd expect it not to leave anything at the
destination path.  However, it appears to leave an empty file instead:

$ ls -l
total 0
$ echo "some data" > src
$ cp --reflink=always src dest
cp: failed to clone 'dest' from 'src': Operation not supported
$ ls -l
total 4
-rw-rw-r--. 1 bgilbert bgilbert  0 Jul  5 01:27 dest
-rw-rw-r--. 1 bgilbert bgilbert 10 Jul  5 01:27 src

I'm seeing this on both coreutils 9.0 (Fedora 36) and 9.1.31-fa332
built from Git.

Best,
--Benjamin Gilbert



This bug report was last modified 3 years and 47 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.