]> granicus.if.org Git - zfs/commitdiff
Illumos #4322
authorSteven Hartland <smh@freebsd.org>
Tue, 19 Nov 2013 13:48:28 +0000 (00:48 +1100)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 Nov 2013 23:27:32 +0000 (15:27 -0800)
4322 ZFS deadlock on dp_config_rwlock
Reviewed by: Matthew Ahrens <mahrens@delphix.com>
Reviewed by: Ilya Usvyatsky <ilya.usvyatsky@nexenta.com>
Approved by: Dan McDonald <danmcd@nexenta.com>

References:
  https://www.illumos.org/issues/4322
  illumos/illumos-gate@c50d56f667f119d78fa3d94d6bef2c298ba556f6

Ported by: Chris Dunlop <chris@onthe.net.au>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #1886

module/zfs/dsl_userhold.c

index 1fca66afb990e4a96efc1486b22a0a759927d919..97775b591fb27f1bae5a32fac5211b0900842806 100644 (file)
@@ -571,21 +571,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. */