]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
zfs: fix EIO accessing dataset after resuming interrupted receive
authorasomers <asomers@FreeBSD.org>
Thu, 20 Aug 2020 01:31:21 +0000 (01:31 +0000)
committerasomers <asomers@FreeBSD.org>
Thu, 20 Aug 2020 01:31:21 +0000 (01:31 +0000)
commita74323efe6f41d2ab63f8078e8c38fdc5648aadc
tree332db636d41f4a16c17d90063d54d8c5d7545de2
parent9e19d3a0c125ca4ef0671c7d1e73fd49f73f75bb
zfs: fix EIO accessing dataset after resuming interrupted receive

ZFS unmounts a dataset while receiving into it and remounts it afterwards.
But if ZFS is resuming an incomplete receive, it screws up and ends up with
a dataset that is mounted, but returns EIO for every access. This commit
fixes that condition.

While the vulnerable code also exists in OpenZFS, the problem is not
reproducible there. Apparently OpenZFS doesn't unmount the destination
dataset during receive, like FreeBSD does.

PR: 248606
Reviewed by: mmacy
MFC after: 2 weeks
Sponsored by: Axcient
Differential Revision: https://reviews.freebsd.org/D26034
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c