Skip to content

btrfs initial full receive fails with "ERROR: failed to clone extents ..." #787

Open
@SteveElliott

Description

@SteveElliott

With an empty receive directory ...

[steve@colt btrfs] $ ls -latr /mnt/ReceivedSnaps/
total 16
drwxr-xr-x. 1 root root 88 May  2 14:40 ..
drwxr-xr-x  1 root root  0 May  3 15:23 .

A send/receive runs ...

[steve@colt btrfs] $ sudo btrfs send --no-data --compressed-data /tmp/top/SnapsToSend/2024-05-03T15\:06\:52+10\:00_@/ | sudo btrfs receive /mnt/ReceivedSnaps/ -vv 2> receive-vv.log
At subvol /tmp/top/SnapsToSend/2024-05-03T15:06:52+10:00_@/

... and reports a failure.

[steve@colt btrfs] $ tail -n 7 receive-vv.log 
utimes usr/lib/modules/5.15.5-100.fc34.x86_64/modules.builtin.alias.bin
mkfile o4838181-225221-0
rename o4838181-225221-0 -> usr/lib/qt5/plugins/bcompare_ext_kde.so
utimes var/lib/flatpak/repo/objects/c1
set_xattr usr/lib/qt5/plugins/bcompare_ext_kde.so - name=security.selinux data_len=31 data=unconfined_u:object_r:lib_t:s0
clone usr/lib/qt5/plugins/bcompare_ext_kde.so - source=usr/lib64/qt5/plugins/bcompare_ext_kde.so source offset=0 offset=0 length=131072
ERROR: failed to clone extents to usr/lib/qt5/plugins/bcompare_ext_kde.so: Invalid argument

A closer inspection shows that an attempt is made to clone the lib version of the target file from the lib64 version.

[steve@colt btrfs] $ grep -C 6 bcompare_ext receive-vv.log 
>8..snip..>8
mkfile o315129-17403-0
rename o315129-17403-0 -> usr/lib64/qt5/plugins/bcompare_ext_kde.so
utimes usr/lib64/python2.7/lib-tk/test
set_xattr usr/lib64/qt5/plugins/bcompare_ext_kde.so - name=security.selinux data_len=27 data=system_u:object_r:lib_t:s0
update_extent usr/lib64/qt5/plugins/bcompare_ext_kde.so: offset=0, len=131072
update_extent usr/lib64/qt5/plugins/bcompare_ext_kde.so: offset=131072, len=131072
update_extent usr/lib64/qt5/plugins/bcompare_ext_kde.so: offset=262144, len=131072
update_extent usr/lib64/qt5/plugins/bcompare_ext_kde.so: offset=393216, len=78600
chown usr/lib64/qt5/plugins/bcompare_ext_kde.so - uid=0, gid=0
chmod usr/lib64/qt5/plugins/bcompare_ext_kde.so - mode=0755
utimes usr/lib64/qt5/plugins/bcompare_ext_kde.so
>8 ..snip.. >8
--
>8 ..snip.. >8
mkfile o4838181-225221-0
rename o4838181-225221-0 -> usr/lib/qt5/plugins/bcompare_ext_kde.so
utimes var/lib/flatpak/repo/objects/c1
set_xattr usr/lib/qt5/plugins/bcompare_ext_kde.so - name=security.selinux data_len=31 data=unconfined_u:object_r:lib_t:s0
clone usr/lib/qt5/plugins/bcompare_ext_kde.so - source=usr/lib64/qt5/plugins/bcompare_ext_kde.so source offset=0 offset=0 length=131072
ERROR: failed to clone extents to usr/lib/qt5/plugins/bcompare_ext_kde.so: Invalid argument

This is attempted even though the source files have distinct inodes and no parent subvols are involved.

[steve@colt btrfs] $ ls -lai /usr/lib/qt5/plugins/bcompare_ext_kde.so 
4838181 -rwxr-xr-x. 1 root root 471816 Feb 17 15:54 /usr/lib/qt5/plugins/bcompare_ext_kde.so
[steve@colt btrfs] $ ls -lai /usr/lib64/qt5/plugins/bcompare_ext_kde.so 
315129 -rwxr-xr-x. 1 root root 471816 Feb 17 15:54 /usr/lib64/qt5/plugins/bcompare_ext_kde.so
[steve@colt btrfs] $ 

My software versions ....

[steve@colt btrfs] $ uname -a
Linux colt 6.8.7-100.fc38.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Apr 17 19:34:28 UTC 2024 x86_64 GNU/Linux
[steve@colt btrfs] $ cat /etc/fedora-release
Fedora release 38 (Thirty Eight)
[steve@colt btrfs] $ bash --version
GNU bash, version 5.2.26(1)-release (x86_64-redhat-linux-gnu)
[steve@colt btrfs] $ btrfs --version
btrfs-progs v6.8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions