Skip to content

Commit

Permalink
Fix dsl_props_set_sync_impl to work with nested nvlist
Browse files Browse the repository at this point in the history
  • Loading branch information
loli10K committed Dec 17, 2016
1 parent 1528bfd commit 1e3854a
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions module/zfs/dsl_prop.c
Original file line number Diff line number Diff line change
Expand Up @@ -892,6 +892,7 @@ dsl_props_set_sync_impl(dsl_dataset_t *ds, zprop_source_t source,

while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
nvpair_t *pair = elem;
const char *name = nvpair_name(pair);

if (nvpair_type(pair) == DATA_TYPE_NVLIST) {
/*
Expand All @@ -904,14 +905,14 @@ dsl_props_set_sync_impl(dsl_dataset_t *ds, zprop_source_t source,

if (nvpair_type(pair) == DATA_TYPE_STRING) {
const char *value = fnvpair_value_string(pair);
dsl_prop_set_sync_impl(ds, nvpair_name(pair),
dsl_prop_set_sync_impl(ds, name,
source, 1, strlen(value) + 1, value, tx);
} else if (nvpair_type(pair) == DATA_TYPE_UINT64) {
uint64_t intval = fnvpair_value_uint64(pair);
dsl_prop_set_sync_impl(ds, nvpair_name(pair),
dsl_prop_set_sync_impl(ds, name,
source, sizeof (intval), 1, &intval, tx);
} else if (nvpair_type(pair) == DATA_TYPE_BOOLEAN) {
dsl_prop_set_sync_impl(ds, nvpair_name(pair),
dsl_prop_set_sync_impl(ds, name,
source, 0, 0, NULL, tx);
} else {
panic("invalid nvpair type");
Expand Down

0 comments on commit 1e3854a

Please sign in to comment.