zfs/lib
наб 30620ad8e1 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
2021-06-23 13:22:14 -07:00
..
libavl Fixes for make dist 2020-06-26 14:20:02 -07:00
libefi pool may become suspended during device expansion 2020-09-18 12:38:30 -07:00
libicp Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libnvpair Include the ABI with dist tarball 2020-11-22 10:01:47 -08:00
libshare zpool command complains about /etc/exports.d 2020-10-01 12:20:06 -07:00
libspl FreeBSD: fix HEAD build, conditionally remove FDSYNC defines 2021-01-24 16:05:56 -08:00
libtpool Clean up lib dependencies 2020-07-10 14:26:00 -07:00
libunicode Fixes for make dist 2020-06-26 14:20:02 -07:00
libuutil Fix a resource leak in uu_avl_pool_destroy 2021-01-28 11:39:00 -08:00
libzfs libzfs: refresh property cache after inheriting userprop 2021-06-23 13:22:14 -07:00
libzfs_core libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 2021-06-23 13:22:14 -07:00
libzfsbootenv libzfsbootenv: do not depend on libnvpair 2020-11-24 10:27:14 -08:00
libzpool libzpool: set_global_var: fix endianness handling (fixes zdb -o ) 2021-03-05 12:51:48 -08:00
libzstd Avoid symbol collision with in-kernel zstdlib 2020-08-24 12:20:41 -07:00
libzutil libzutil: zfs_isnumber(): return false if input empty 2021-06-23 13:22:14 -07:00
Makefile.am Library ABI tracking with abigail 2020-11-17 20:29:02 +00:00