HomeFreeBSD

Fix EIO after resuming receive of new dataset over an existing one

Description

Fix EIO after resuming receive of new dataset over an existing one

When resuming an interrupted ZFS send stream that creates a new dataset
with the same name as an existing dataset, if the existing dataset is
accessed after the failed receive, then after the subsequent successful
receive it will return EIO. This happens because nothing mounts the new
dataset, leaving the old, no longer valid dataset still mounted.

This commit fixes zfs receive to always unmount and remount the
destination, regardless of whether the stream is a new stream or a
resumed stream.

Sponsored by: Axcient
Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Signed-off-by: Alan Somers <asomers@gmail.com>
External-issue: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=249579
Closes #10995
Closes #10999

Details

Provenance
asomersAuthored on Oct 3 2020, 12:47 AM
GitHub <noreply@github.com>Committed on Oct 3 2020, 12:47 AM
Parents
rG4d55ea811d4f: Throw const on some strings
Branches
Unknown
Tags
Unknown