Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Aug 2020 16:27:58 +0000 (UTC)
From:      Alan Somers <asomers@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r364974 - stable/12/cddl/contrib/opensolaris/lib/libzfs/common
Message-ID:  <202008301627.07UGRwQY050677@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: asomers
Date: Sun Aug 30 16:27:58 2020
New Revision: 364974
URL: https://svnweb.freebsd.org/changeset/base/364974

Log:
  MFC r364412:
  
  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
  Sponsored by:	Axcient
  Differential Revision:	https://reviews.freebsd.org/D26034

Modified:
  stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c
==============================================================================
--- stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Sun Aug 30 07:34:32 2020	(r364973)
+++ stable/12/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_sendrecv.c	Sun Aug 30 16:27:58 2020	(r364974)
@@ -3433,7 +3433,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const 
 		}
 
 		if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
-		    stream_wantsnewfs) {
+		    (stream_wantsnewfs || resuming)) {
 			/* We can't do online recv in this case */
 			clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0);
 			if (clp == NULL) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202008301627.07UGRwQY050677>