Hi,
I am proposing two patches to solve an issue when copying reflink on
a non-btrfs file system. This issue was already previously discussed [1, 2].
The first one cleans only on a reflink creation failure. The second one was
based on the previously refused patch [2] and it is more general solution.
I am not sure if this behavior is considered to be a bug. There is no
specification what to do in situations like this and whether the empty file
should be left or unlinked [3]. Nevertheless it would be nice to handle this
issue.
Have a nice day!
Fridolin Pokorny
[1] https://bugzilla.redhat.com/show_bug.cgi?id=921708
[2] http://lists.gnu.org/archive/html/coreutils/2013-03/msg00056.html
[3] http://pubs.opengroup.org/onlinepubs/007904875/utilities/cp.html