Print this page
5056 ZFS deadlock on db_mtx and dn_holds
Reviewed by: Will Andrews <willa@spectralogic.com>
Reviewed by: Matt Ahrens <mahrens@delphix.com>
Reviewed by: George Wilson <george.wilson@delphix.com>
Approved by: Dan McDonald <danmcd@omniti.com>

@@ -161,23 +161,21 @@
 dsl_prop_get_ds(dsl_dataset_t *ds, const char *propname,
     int intsz, int numints, void *buf, char *setpoint)
 {
         zfs_prop_t prop = zfs_name_to_prop(propname);
         boolean_t inheritable;
-        boolean_t snapshot;
         uint64_t zapobj;
 
         ASSERT(dsl_pool_config_held(ds->ds_dir->dd_pool));
         inheritable = (prop == ZPROP_INVAL || zfs_prop_inheritable(prop));
-        snapshot = dsl_dataset_is_snapshot(ds);
         zapobj = dsl_dataset_phys(ds)->ds_props_obj;
 
         if (zapobj != 0) {
                 objset_t *mos = ds->ds_dir->dd_pool->dp_meta_objset;
                 int err;
 
-                ASSERT(snapshot);
+                ASSERT(ds->ds_is_snapshot);
 
                 /* Check for a local value. */
                 err = zap_lookup(mos, zapobj, propname, intsz, numints, buf);
                 if (err != ENOENT) {
                         if (setpoint != NULL && err == 0)

@@ -213,11 +211,11 @@
                         }
                 }
         }
 
         return (dsl_prop_get_dd(ds->ds_dir, propname,
-            intsz, numints, buf, setpoint, snapshot));
+            intsz, numints, buf, setpoint, ds->ds_is_snapshot));
 }
 
 /*
  * Register interest in the named property.  We'll call the callback
  * once to notify it of the current property value, and again each time

@@ -543,11 +541,11 @@
         int err;
         uint64_t version = spa_version(ds->ds_dir->dd_pool->dp_spa);
 
         isint = (dodefault(propname, 8, 1, &intval) == 0);
 
-        if (dsl_dataset_is_snapshot(ds)) {
+        if (ds->ds_is_snapshot) {
                 ASSERT(version >= SPA_VERSION_SNAP_PROPS);
                 if (dsl_dataset_phys(ds)->ds_props_obj == 0) {
                         dmu_buf_will_dirty(ds->ds_dbuf, tx);
                         dsl_dataset_phys(ds)->ds_props_obj =
                             zap_create(mos,

@@ -640,11 +638,11 @@
         strfree(recvdstr);
 
         if (isint) {
                 VERIFY0(dsl_prop_get_int_ds(ds, propname, &intval));
 
-                if (dsl_dataset_is_snapshot(ds)) {
+                if (ds->ds_is_snapshot) {
                         dsl_prop_cb_record_t *cbr;
                         /*
                          * It's a snapshot; nothing can inherit this
                          * property, so just look for callbacks on this
                          * ds here.

@@ -758,11 +756,11 @@
                                 return (E2BIG);
                         }
                 }
         }
 
-        if (dsl_dataset_is_snapshot(ds) && version < SPA_VERSION_SNAP_PROPS) {
+        if (ds->ds_is_snapshot && version < SPA_VERSION_SNAP_PROPS) {
                 dsl_dataset_rele(ds, FTAG);
                 return (SET_ERROR(ENOTSUP));
         }
         dsl_dataset_rele(ds, FTAG);
         return (0);

@@ -981,11 +979,11 @@
         int err = 0;
         char setpoint[MAXNAMELEN];
 
         VERIFY(nvlist_alloc(nvp, NV_UNIQUE_NAME, KM_SLEEP) == 0);
 
-        if (dsl_dataset_is_snapshot(ds))
+        if (ds->ds_is_snapshot)
                 flags |= DSL_PROP_GET_SNAPSHOT;
 
         ASSERT(dsl_pool_config_held(dp));
 
         if (dsl_dataset_phys(ds)->ds_props_obj != 0) {