From mm@mail2.vx.sk  Sun Apr  4 11:19:59 2010
Return-Path: <mm@mail2.vx.sk>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 4D267106567C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Apr 2010 11:19:59 +0000 (UTC)
	(envelope-from mm@mail2.vx.sk)
Received: from mail2.vx.sk (neo.vx.sk [188.40.111.84])
	by mx1.freebsd.org (Postfix) with ESMTP id 0E0E48FC0C
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Apr 2010 11:19:58 +0000 (UTC)
Received: from neo.vx.sk (localhost [127.0.0.1])
	by mail2.vx.sk (Postfix) with ESMTP id 9727129BDE
	for <FreeBSD-gnats-submit@freebsd.org>; Sun,  4 Apr 2010 13:19:57 +0200 (CEST)
Received: from mail2.vx.sk ([127.0.0.1])
	by neo.vx.sk (neo.vx.sk [127.0.0.1]) (amavisd-new, port 10024)
	with LMTP id AY3XpsphFVkI for <FreeBSD-gnats-submit@freebsd.org>;
	Sun,  4 Apr 2010 13:19:52 +0200 (CEST)
Received: by mail2.vx.sk (Postfix, from userid 1001)
	id AD74529BBD; Sun,  4 Apr 2010 13:19:52 +0200 (CEST)
Message-Id: <20100404111952.AD74529BBD@mail2.vx.sk>
Date: Sun,  4 Apr 2010 13:19:52 +0200 (CEST)
From: Martin Matuska <mm@FreeBSD.org>
Reply-To: Martin Matuska <mm@FreeBSD.org>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [zfs] [patch] fix zfs bug (vendor import)
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         145377
>Category:       kern
>Synopsis:       [zfs] [patch] fix zfs bug (vendor import)
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    delphij
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 04 11:20:09 UTC 2010
>Closed-Date:    Mon Apr 05 18:29:29 UTC 2010
>Last-Modified:  Mon Apr  5 18:30:09 UTC 2010
>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@neo.vx.sk:/usr/obj/usr/src/sys/NEO amd64
>Description:
As reported by Andriy Gapon <abg@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:
Index: cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
===================================================================
--- cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	(revision 206157)
+++ cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	(working copy)
@@ -4288,7 +4288,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:
Responsible-Changed-From-To: freebsd-bugs->delphij 
Responsible-Changed-By: delphij 
Responsible-Changed-When: Sun Apr 4 13:10:41 UTC 2010 
Responsible-Changed-Why:  
Take. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145377 
State-Changed-From-To: open->closed 
State-Changed-By: delphij 
State-Changed-When: Mon Apr 5 18:28:09 UTC 2010 
State-Changed-Why:  
Patched on -HEAD and revision 205198 was not yet MFC'ed. 
Thanks for your submission! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=145377 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/145377: commit references a PR
Date: Mon,  5 Apr 2010 18:28:12 +0000 (UTC)

 Author: delphij
 Date: Mon Apr  5 18:27:58 2010
 New Revision: 206199
 URL: http://svn.freebsd.org/changeset/base/206199
 
 Log:
   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
 
 Modified:
   head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
 
 Modified: head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
 ==============================================================================
 --- head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Mon Apr  5 18:25:30 2010	(r206198)
 +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c	Mon Apr  5 18:27:58 2010	(r206199)
 @@ -4288,7 +4288,12 @@ zfs_prune_proplist(zfs_handle_t *zhp, ui
  		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;
 _______________________________________________
 svn-src-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-src-all
 To unsubscribe, send any mail to "svn-src-all-unsubscribe@freebsd.org"
 
>Unformatted:
