diff options
author | наб <[email protected]> | 2021-04-16 20:03:20 +0200 |
---|---|---|
committer | Brian Behlendorf <[email protected]> | 2021-04-19 15:22:58 -0700 |
commit | 121a34e36b4af0560143a56b0975e84c6d2247f6 (patch) | |
tree | d3051857c58ff57c761aa632685ff6de47c0753c /lib/libzfs | |
parent | dfa2beddea1623531ff774cd1cce5701b97cfa39 (diff) |
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
Diffstat (limited to 'lib/libzfs')
-rw-r--r-- | lib/libzfs/libzfs_dataset.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index f469f3a4b..e73418947 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1953,6 +1953,7 @@ zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received) if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_INHERIT_PROP, &zc) != 0) return (zfs_standard_error(hdl, errno, errbuf)); + (void) get_stats(zhp); return (0); } |