mirror_zfs/lib
наб a31ac10185 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-17 12:39:54 -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-11 15:45:59 -07:00
libspl linux/libspl: gethostid: read from /proc/sys/kernel/spl/hostid, simplify 2021-04-15 14:55:47 -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 libuutil: purge unused functions 2021-04-12 09:32:43 -07:00
libzfs libzfs: refresh property cache after inheriting userprop 2021-04-17 12:39:54 -07:00
libzfs_core libzfs{,_core}: set O_CLOEXEC on persistent (ZFS_DEV and MNTTAB) fds 2021-04-11 15:45:31 -07:00
libzfsbootenv Fix various typos 2021-04-02 18:52:15 -07:00
libzpool lib/: set O_CLOEXEC on all fds 2021-04-11 15:45:59 -07:00
libzstd cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00
libzutil lib/: set O_CLOEXEC on all fds 2021-04-11 15:45:59 -07:00
Makefile.am cppcheck: integrete cppcheck 2021-01-26 16:12:26 -08:00