diff options
author | smh <smh@FreeBSD.org> | 2013-11-25 20:47:37 +0000 |
---|---|---|
committer | smh <smh@FreeBSD.org> | 2013-11-25 20:47:37 +0000 |
commit | cb9e583d86990eba0d5af8913cdbbb20da5b2c9e (patch) | |
tree | e5b499d9b4aa1939f29bf665ead00044d0b57b0e /sys/cddl/contrib/opensolaris/uts | |
parent | cd3fab467adf57c1f8da006ca643ad5fe12fa3a5 (diff) | |
download | FreeBSD-src-cb9e583d86990eba0d5af8913cdbbb20da5b2c9e.zip FreeBSD-src-cb9e583d86990eba0d5af8913cdbbb20da5b2c9e.tar.gz |
MFC r258294:
Fix ZFS deadlock when sending a snapshot which is mounted.
Approved by: re (glebius)
Sponsored by: Multiplay
Diffstat (limited to 'sys/cddl/contrib/opensolaris/uts')
-rw-r--r-- | sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c index a948e10..7f2c26f 100644 --- a/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c +++ b/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/dsl_userhold.c @@ -564,21 +564,23 @@ dsl_dataset_user_release_impl(nvlist_t *holds, nvlist_t *errlist, 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. */ |