Skip to content

Resuming incremental send results in "invalid cross-device link" #6619

@dsnet

Description

@dsnet
Type Version/Name
Distribution Name Ubuntu
Distribution Version 16.04.2
Linux Kernel 4.4.0-62-generic
Architecture x64
SPL Version 0.7.0-12_g9df9692
ZFS Version 0.7.0-50_g1ea8942

I ran the following:

# Create a new pool.
$ truncate -s 1G ~/dev
$ sudo zpool create tank ~/dev

# Add some data and snapshot.
$ sudo dd if=/dev/urandom of=/tank/foo bs=1M count=50
$ sudo zfs snapshot tank@snap1

# Create a mirror.
$ sudo zfs send tank@snap1 | sudo zfs recv -s tank/mirror

# Add some data and snapshot.
$ sudo dd if=/dev/urandom of=/tank/bar bs=1M count=50
$ sudo zfs snapshot tank@snap2

# Intentionally create a partial send.
$ sudo zfs send -i tank@snap1 tank@snap2 | head -c 20000000 | sudo zfs recv -s tank/mirror
$ TOKEN=$(sudo zfs get -H receive_resume_token tank/mirror | cut -f 3)

# Just try and send the partial snapshot.
$ sudo zfs send -t $TOKEN > /dev/null
warning: cannot send 'tank@snap2': Invalid cross-device link

$ sudo zfs send -nP -t $TOKEN
resume token contents:
nvlist version: 0
	fromguid = 0x7eb9f6bf27d4bfc1
	object = 0x4
	offset = 0x12e0000
	bytes = 0x130cbd8
	toguid = 0xf121966674ca8619
	toname = tank@snap2
incremental	tank/mirror@snap1	tank@snap2

$ echo $?
18

Several strange occurrences:

  • The zfs send -t fails with "Invalid cross-device link" warning, which should really be an error.
  • The zfs send -nP -t reports that the source is tank/mirror@snap1 instead of tank@snap1. This is probably what causes zfs to think this is a "cross-device link" problem. It is impossible for it to satisfy this token request since that mirror doesn't have the data!
  • The zfs send -nP -t prints no error, but the return value is EXDEV

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions