Print this page
3006 VERIFY[S,U,P] and ASSERT[S,U,P] frequently check if first argument is zero


2226         }
2227 
2228         error = zap_update(os, MASTER_NODE_OBJ, ZPL_VERSION_STR,
2229             8, 1, &newvers, tx);
2230 
2231         if (error) {
2232                 dmu_tx_commit(tx);
2233                 return (error);
2234         }
2235 
2236         if (newvers >= ZPL_VERSION_SA && !zfsvfs->z_use_sa) {
2237                 uint64_t sa_obj;
2238 
2239                 ASSERT3U(spa_version(dmu_objset_spa(zfsvfs->z_os)), >=,
2240                     SPA_VERSION_SA);
2241                 sa_obj = zap_create(os, DMU_OT_SA_MASTER_NODE,
2242                     DMU_OT_NONE, 0, tx);
2243 
2244                 error = zap_add(os, MASTER_NODE_OBJ,
2245                     ZFS_SA_ATTRS, 8, 1, &sa_obj, tx);
2246                 ASSERT3U(error, ==, 0);
2247 
2248                 VERIFY(0 == sa_set_sa_object(os, sa_obj));
2249                 sa_register_update_callback(os, zfs_sa_upgrade);
2250         }
2251 
2252         spa_history_log_internal_ds(dmu_objset_ds(os), "upgrade", tx,
2253             "from %llu to %llu", zfsvfs->z_version, newvers);
2254 
2255         dmu_tx_commit(tx);
2256 
2257         zfsvfs->z_version = newvers;
2258 
2259         zfs_set_fuid_feature(zfsvfs);
2260 
2261         return (0);
2262 }
2263 
2264 /*
2265  * Read a property stored within the master node.
2266  */




2226         }
2227 
2228         error = zap_update(os, MASTER_NODE_OBJ, ZPL_VERSION_STR,
2229             8, 1, &newvers, tx);
2230 
2231         if (error) {
2232                 dmu_tx_commit(tx);
2233                 return (error);
2234         }
2235 
2236         if (newvers >= ZPL_VERSION_SA && !zfsvfs->z_use_sa) {
2237                 uint64_t sa_obj;
2238 
2239                 ASSERT3U(spa_version(dmu_objset_spa(zfsvfs->z_os)), >=,
2240                     SPA_VERSION_SA);
2241                 sa_obj = zap_create(os, DMU_OT_SA_MASTER_NODE,
2242                     DMU_OT_NONE, 0, tx);
2243 
2244                 error = zap_add(os, MASTER_NODE_OBJ,
2245                     ZFS_SA_ATTRS, 8, 1, &sa_obj, tx);
2246                 ASSERT0(error);
2247 
2248                 VERIFY(0 == sa_set_sa_object(os, sa_obj));
2249                 sa_register_update_callback(os, zfs_sa_upgrade);
2250         }
2251 
2252         spa_history_log_internal_ds(dmu_objset_ds(os), "upgrade", tx,
2253             "from %llu to %llu", zfsvfs->z_version, newvers);
2254 
2255         dmu_tx_commit(tx);
2256 
2257         zfsvfs->z_version = newvers;
2258 
2259         zfs_set_fuid_feature(zfsvfs);
2260 
2261         return (0);
2262 }
2263 
2264 /*
2265  * Read a property stored within the master node.
2266  */