mirror_zfs/lib/libzfs
наб 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
..
os lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
.gitignore
libzfs_changelist.c
libzfs_config.c
libzfs_crypto.c libzfs: don't mark prompt+raw as retriable 2021-04-19 15:22:58 -07:00
libzfs_dataset.c libzfs: refresh property cache after inheriting userprop 2021-04-19 15:22:58 -07:00
libzfs_diff.c lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libzfs_import.c
libzfs_iter.c lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libzfs_mount.c libzfs: zfs_mount_at(): load key for encryption root if MS_CRYPT 2021-04-14 13:23:08 -07:00
libzfs_pool.c Improvements to the 'compatibility' property 2021-04-14 13:23:08 -07:00
libzfs_sendrecv.c cmd/zfs receive: allow dry-run (-n) to check property args 2021-04-14 13:23:08 -07:00
libzfs_status.c Improvements to the 'compatibility' property 2021-04-14 13:23:08 -07:00
libzfs_util.c lib/: set O_CLOEXEC on all fds 2021-04-14 13:23:07 -07:00
libzfs.abi Improvements to the 'compatibility' property 2021-04-14 13:23:08 -07:00
libzfs.pc.in
libzfs.suppr
Makefile.am
THIRDPARTYLICENSE.openssl
THIRDPARTYLICENSE.openssl.descrip