kern/145377: [zfs] [patch] fix zfs bug (vendor import)

Martin Matuska mm at FreeBSD.org
Sun Apr 4 11:20:11 UTC 2010


>Number:         145377
>Category:       kern
>Synopsis:       [zfs] [patch] fix zfs bug (vendor import)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 04 11:20:09 UTC 2010
>Closed-Date:
>Last-Modified:
>Originator:     Martin Matuska
>Release:        FreeBSD 8.0-RELEASE-p2 amd64
>Organization:
>Environment:
System: FreeBSD neo.vx.sk 8.0-RELEASE-p2 FreeBSD 8.0-RELEASE-p2 #16: Fri Jan 15 21:10:48 CET 2010 root at neo.vx.sk:/usr/obj/usr/src/sys/NEO amd64
>Description:
As reported by Andriy Gapon <abg at FreeBSD.org> via e-mail:

"
It seems that this commit causes a crash in zfs(1) when e.g. 'zfs list' is
executed and one of the filesystems has a user property set on it.

The crash is in zfs_prune_proplist function at
cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c:4291.
"

The issue has been fixed in OpenSolaris onnv-gate revision 9396.
An associated OpenSolaris bug-id cannot be determined.

Solution: partial vendor import of OpenSolaris rev. 9396 (just the bugfix)

References:
http://src.opensolaris.org/source/diff/onnv/onnv-gate/usr/src/lib/libzfs/common/libzfs_dataset.c?r2=%252Fonnv%252Fonnv-gate%252Fusr%252Fsrc%252Flib%252Flibzfs%252Fcommon%252Flibzfs_dataset.c%409396%3Af41cf682d0d3&r1=%252Fonnv%252Fonnv-gate%252Fusr%252Fsrc%252Flib%252Flibzfs%252Fcommon%252Flibzfs_dataset.c%408845%3A91af0d9c0790
>How-To-Repeat:
>Fix:
@@ -4488,7 +3934,12 @@
 		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;
>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-bugs mailing list