Skip to content

Commit a31ac10

Browse files
nabijaczlewelibehlendorf
authored andcommitted
libzfs: refresh property cache after inheriting userprop
This matches what happens when inheriting a system property Consider the following program: int main() { void *zhp = libzfs_init(); void *dataset = zfs_open(zhp, "zest/__test", 1); printf("before:"); dump_nvlist(zfs_get_user_props(dataset), 2); printf("\n"); zfs_prop_inherit(dataset, "xyz.nabijaczleweli:test", 0); printf("after:"); dump_nvlist(zfs_get_user_props(dataset), 2); printf("\n"); zfs_refresh_properties(dataset); printf("refreshed:"); dump_nvlist(zfs_get_user_props(dataset), 2); printf("\n"); } And the output before: # zfs set xyz.nabijaczleweli:test=hehe zest/__test # ./a.out before: xyz.nabijaczleweli:test: value: 'hehe' source: 'zest/__test' after: xyz.nabijaczleweli:test: value: 'hehe' source: 'zest/__test' refreshed: As compared to the output after: # zfs set xyz.nabijaczleweli:test=hehe zest/__test # ./a.out before: xyz.nabijaczleweli:test: value: 'hehe' source: 'zest/__test' after: refreshed: Reviewed-by: Brian Behlendorf <[email protected]> Signed-off-by: Ahelenia Ziemiańska <[email protected]> Closes #11064 Closes #11911
1 parent bfe8b9f commit a31ac10

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

lib/libzfs/libzfs_dataset.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1953,6 +1953,7 @@ zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received)
19531953
if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_INHERIT_PROP, &zc) != 0)
19541954
return (zfs_standard_error(hdl, errno, errbuf));
19551955

1956+
(void) get_stats(zhp);
19561957
return (0);
19571958
}
19581959

0 commit comments

Comments
 (0)