Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 18 Feb 2014 15:30:11 +0000 (UTC)
From:      Andriy Gapon <avg@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r262176 - stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Message-ID:  <201402181530.s1IFUBke010542@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: avg
Date: Tue Feb 18 15:30:11 2014
New Revision: 262176
URL: http://svnweb.freebsd.org/changeset/base/262176

Log:
  MFC r258294: Fix ZFS deadlock when sending a snapshot which is mounted

Modified:
  stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c
Directory Properties:
  stable/8/sys/   (props changed)
  stable/8/sys/cddl/   (props changed)
  stable/8/sys/cddl/contrib/opensolaris/   (props changed)

Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c	Tue Feb 18 15:29:53 2014	(r262175)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c	Tue Feb 18 15:30:11 2014	(r262176)
@@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t *
 		ddura.ddura_holdfunc = dsl_dataset_hold_obj_string;
 		pool = spa_name(tmpdp->dp_spa);
 #ifdef _KERNEL
-		dsl_pool_config_enter(tmpdp, FTAG);
 		for (pair = nvlist_next_nvpair(holds, NULL); pair != NULL;
 		    pair = nvlist_next_nvpair(holds, pair)) {
 			dsl_dataset_t *ds;
 
+			dsl_pool_config_enter(tmpdp, FTAG);
 			error = dsl_dataset_hold_obj_string(tmpdp,
 			    nvpair_name(pair), FTAG, &ds);
 			if (error == 0) {
 				char name[MAXNAMELEN];
 				dsl_dataset_name(ds, name);
+				dsl_pool_config_exit(tmpdp, FTAG);
 				dsl_dataset_rele(ds, FTAG);
 				(void) zfs_unmount_snap(name);
+			} else {
+				dsl_pool_config_exit(tmpdp, FTAG);
 			}
 		}
-		dsl_pool_config_exit(tmpdp, FTAG);
 #endif
 	} else {
 		/* Non-temporary holds are specified by name. */



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