Print this page
*** NO COMMENTS ***

@@ -287,11 +287,10 @@
                 dsl_dir_close(ds->ds_dir, ds);
 
         ASSERT(!list_link_active(&ds->ds_synced_link));
 
         mutex_destroy(&ds->ds_lock);
-        mutex_destroy(&ds->ds_recvlock);
         mutex_destroy(&ds->ds_opening_lock);
         rw_destroy(&ds->ds_rwlock);
         cv_destroy(&ds->ds_exclusive_cv);
 
         kmem_free(ds, sizeof (dsl_dataset_t));

@@ -393,11 +392,10 @@
                 ds->ds_dbuf = dbuf;
                 ds->ds_object = dsobj;
                 ds->ds_phys = dbuf->db_data;
 
                 mutex_init(&ds->ds_lock, NULL, MUTEX_DEFAULT, NULL);
-                mutex_init(&ds->ds_recvlock, NULL, MUTEX_DEFAULT, NULL);
                 mutex_init(&ds->ds_opening_lock, NULL, MUTEX_DEFAULT, NULL);
                 mutex_init(&ds->ds_sendstream_lock, NULL, MUTEX_DEFAULT, NULL);
 
                 rw_init(&ds->ds_rwlock, 0, 0, 0);
                 cv_init(&ds->ds_exclusive_cv, NULL, CV_DEFAULT, NULL);

@@ -413,11 +411,10 @@
                         err = dsl_dir_open_obj(dp,
                             ds->ds_phys->ds_dir_obj, NULL, ds, &ds->ds_dir);
                 }
                 if (err) {
                         mutex_destroy(&ds->ds_lock);
-                        mutex_destroy(&ds->ds_recvlock);
                         mutex_destroy(&ds->ds_opening_lock);
                         rw_destroy(&ds->ds_rwlock);
                         cv_destroy(&ds->ds_exclusive_cv);
                         bplist_destroy(&ds->ds_pending_deadlist);
                         dsl_deadlist_close(&ds->ds_deadlist);

@@ -481,11 +478,10 @@
                         dsl_deadlist_close(&ds->ds_deadlist);
                         if (ds->ds_prev)
                                 dsl_dataset_drop_ref(ds->ds_prev, ds);
                         dsl_dir_close(ds->ds_dir, ds);
                         mutex_destroy(&ds->ds_lock);
-                        mutex_destroy(&ds->ds_recvlock);
                         mutex_destroy(&ds->ds_opening_lock);
                         rw_destroy(&ds->ds_rwlock);
                         cv_destroy(&ds->ds_exclusive_cv);
                         kmem_free(ds, sizeof (dsl_dataset_t));
                         if (err) {

@@ -544,17 +540,19 @@
          * the dataset is determined.
          */
         ASSERT(!RW_WRITE_HELD(&dp->dp_config_rwlock));
         mutex_enter(&ds->ds_lock);
         while (!rw_tryenter(&ds->ds_rwlock, RW_READER)) {
+                int rc;
+
                 rw_exit(&dp->dp_config_rwlock);
-                cv_wait(&ds->ds_exclusive_cv, &ds->ds_lock);
-                if (DSL_DATASET_IS_DESTROYED(ds)) {
+                rc = cv_wait_sig(&ds->ds_exclusive_cv, &ds->ds_lock);
+                if (!rc || DSL_DATASET_IS_DESTROYED(ds)) {
                         mutex_exit(&ds->ds_lock);
                         dsl_dataset_drop_ref(ds, tag);
                         rw_enter(&dp->dp_config_rwlock, RW_READER);
-                        return (ENOENT);
+                        return (rc ? ENOENT : EINTR);
                 }
                 /*
                  * The dp_config_rwlock lives above the ds_lock. And
                  * we need to check DSL_DATASET_IS_DESTROYED() while
                  * holding the ds_lock, so we have to drop and reacquire