From a705085182233e7809d54657d58211000e9cdeaf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=BD=D0=B0=D0=B1?= Date: Fri, 16 Apr 2021 20:03:20 +0200 Subject: [PATCH] libzfs: refresh property cache after inheriting userprop MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 Signed-off-by: Ahelenia ZiemiaƄska Closes #11064 Closes #11911 --- lib/libzfs/libzfs_dataset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/libzfs/libzfs_dataset.c b/lib/libzfs/libzfs_dataset.c index 788b697a8a5c..688c660f3fb3 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); }