Refine previous partial merge of OpenSolaris onnv revision 9396:f41cf682d0d3.

This fixes a regression that zfs list would crash on zfs having user properties.

PR:		kern/145377
Submitted by:	mm
Approved by:	pjd
Obtained from:	OpenSolaris
MFC after:	10 days
This commit is contained in:
Xin LI 2010-04-05 18:27:58 +00:00
parent 863a6d6bbf
commit 7546d4b74e

View File

@ -4288,7 +4288,12 @@ zfs_prune_proplist(zfs_handle_t *zhp, uint8_t *props)
zfs_prop_t zfs_prop = zfs_name_to_prop(nvpair_name(curr));
nvpair_t *next = nvlist_next_nvpair(zhp->zfs_props, curr);
if (props[zfs_prop] == B_FALSE)
/*
* We leave user:props in the nvlist, so there will be
* some ZPROP_INVAL. To be extra safe, don't prune
* those.
*/
if (zfs_prop != ZPROP_INVAL && props[zfs_prop] == B_FALSE)
(void) nvlist_remove(zhp->zfs_props,
nvpair_name(curr), nvpair_type(curr));
curr = next;