HomeFreeBSD

Fix noop receive of raw send stream

Description

Fix noop receive of raw send stream

Currently, the noop receive code fails to work with raw send streams
and resuming send streams. This happens because zfs_receive_impl()
reads the DRR_BEGIN payload without reading the payload itself.
Normally, the kernel expects to read this itself, but in this case
the recv_skip() code runs instead and it is not prepared to handle
the stream being left at any place other than the beginning of a
record.

This patch resolves this issue by manually reading the DRR_BEGIN
payload in the dry-run case. This patch also includes a number of
small fixups in this code path.

Reviewed-by: George Melikov <mail@gmelikov.ru>
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Paul Dagnelie <pcd@delphix.com>
Signed-off-by: Tom Caputi <tcaputi@datto.com>
Closes #9221
Closes #9173

Details

Provenance
Tom Caputi <tcaputi@datto.com>Authored on Sep 5 2019, 11:22 PM
Brian Behlendorf <behlendorf1@llnl.gov>Committed on Sep 5 2019, 11:22 PM
Parents
rG8e2c502cf3f5: Clean up zfs_clone_010_pos
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG870e7a52c105: Fix noop receive of raw send stream (authored by Tom Caputi <tcaputi@datto.com>).Sep 5 2019, 11:22 PM