zfs/lib/libzfs
LOLi aee1dd4d98 Fix intra-pool resumable 'zfs send -t <token>'
Because resuming from a token requires "guid" -> "snapshot" mapping
we have to walk the whole dataset hierarchy to find the right snapshot
to send; when both source and destination exists, for an incremental
resumable stream, libzfs gets confused and picks up the wrong snapshot
to send from: this results in attempting to send

   "destination@snap1 -> source@snap2"

instead of

   "source@snap1 -> source@snap2"

which fails with a "Invalid cross-device link" error (EXDEV).

Fix this by adjusting the logic behind dataset traversal in
zfs_iter_children() to pick the right snapshot to send from.

Additionally update dry-run 'zfs send -t' to print its output to
stderr: this is consistent with other dry-run commands.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: loli10K <ezomori.nozomu@gmail.com>
Closes #6618
Closes #6619
Closes #6623
2017-10-10 15:22:05 -07:00
..
.gitignore Add a pkgconfig file 2014-08-28 07:59:43 -07:00
Makefile.am Remove FRU and LIBTOPO Support 2017-09-18 17:06:40 -07:00
libzfs.pc.in Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_changelist.c Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
libzfs_config.c OpenZFS 4521 - zfstest is trying to execute evil "zfs unmount -a" 2017-02-03 13:24:44 -08:00
libzfs_core.pc.in Add a pkgconfig file 2014-08-28 07:59:43 -07:00
libzfs_crypto.c Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
libzfs_dataset.c Relax (ref)reservation constraints on ZVOLs 2017-09-12 11:33:22 -07:00
libzfs_diff.c Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
libzfs_import.c Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
libzfs_iter.c Fix intra-pool resumable 'zfs send -t <token>' 2017-10-10 15:22:05 -07:00
libzfs_mount.c Fix some ZFS Test Suite issues 2017-09-25 10:32:34 -07:00
libzfs_pool.c Native Encryption for ZFS on Linux 2017-08-14 10:36:48 -07:00
libzfs_sendrecv.c Fix intra-pool resumable 'zfs send -t <token>' 2017-10-10 15:22:05 -07:00
libzfs_status.c Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00
libzfs_util.c Remove FRU and LIBTOPO Support 2017-09-18 17:06:40 -07:00