mirror_zfs/lib
наб 121a34e36b 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-04-19 15:22:58 -07:00
..
libavl cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libefi cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libicp cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libnvpair cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libshare lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libspl linux/libspl: gethostid: read from /proc/sys/kernel/spl/hostid, simplify 2021-04-19 15:22:57 -07:00
libtpool cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libunicode cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libuutil lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libzfs libzfs: refresh property cache after inheriting userprop 2021-04-19 15:22:58 -07:00
libzfs_core libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 2021-04-14 13:23:07 -07:00
libzfsbootenv Fix various typos 2021-04-07 13:27:11 -07:00
libzpool lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libzstd cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libzutil lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00