mirror_zfs/lib
loli10K 4411de2116 OpenZFS 8940 - Sending an intra-pool resumable send stream may result in EXDEV
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.

Patch Notes:
Reconciled differences between OpenZFS and
aee1dd4d98.

Authored by: loli10K <ezomori.nozomu@gmail.com>
Reviewed by: Paul Dagnelie <pcd@delphix.com>
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov>
Approved by: Hans Rosenfeld <rosenfeld@grumpf.home-2000.org>
Ported-by: Giuseppe Di Natale <dinatale2@llnl.gov>

OpenZFS-issue: https://www.illumos.org/issues/8940
OpenZFS-commit: https://github.com/openzfs/openzfs/commit/9f7867c206
Closes #7171
2018-02-14 14:35:04 -08:00
..
libavl Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libefi Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libicp Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libnvpair Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libshare Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libspl zpool import -d to specify device path 2018-01-26 10:49:46 -08:00
libtpool Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libunicode Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libuutil Support -fsanitize=address with --enable-asan 2018-01-10 10:49:27 -08:00
libzfs OpenZFS 8940 - Sending an intra-pool resumable send stream may result in EXDEV 2018-02-14 14:35:04 -08:00
libzfs_core OpenZFS 8677 - Open-Context Channel Programs 2018-02-08 16:05:57 -08:00
libzpool Increase code coverage for Lua libraries 2018-02-08 15:29:38 -08:00
Makefile.am Add libtpool (thread pools) 2017-08-09 15:31:08 -07:00