diff options
author | наб <nabijaczleweli@nabijaczleweli.xyz> | 2021-04-16 20:03:20 +0200 |
---|---|---|
committer | Brian Behlendorf <behlendorf1@llnl.gov> | 2021-05-19 20:00:08 -0700 |
commit | 2b68f21d0fc847d013a7e44ecaf17701823b06aa (patch) | |
tree | 618343f86048734903ac19d032a26222423ba8b1 | |
parent | f78574b39d7e1e6459ff2bf4ec64f9b1947b6fed (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 <behlendorf1@llnl.gov>
Signed-off-by: Ahelenia Ziemiańska <nabijaczleweli@nabijaczleweli.xyz>
Closes #11064
Closes #11911
-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 788b697a8..688c660f3 100644 --- a/lib/libzfs/libzfs_dataset.c +++ b/lib/libzfs/libzfs_dataset.c @@ -1955,6 +1955,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); } |