From owner-svn-src-all@FreeBSD.ORG Sun Apr 4 11:23:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9D52A106564A; Sun, 4 Apr 2010 11:23:42 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mail.vx.sk (core.vx.sk [188.40.32.143]) by mx1.freebsd.org (Postfix) with ESMTP id 466928FC16; Sun, 4 Apr 2010 11:23:41 +0000 (UTC) Received: from core.vx.sk (localhost [127.0.0.1]) by mail.vx.sk (Postfix) with ESMTP id 9D7FE8147E; Sun, 4 Apr 2010 13:23:40 +0200 (CEST) X-Virus-Scanned: amavisd-new at mail.vx.sk Received: from mail.vx.sk ([127.0.0.1]) by core.vx.sk (mail.vx.sk [127.0.0.1]) (amavisd-new, port 10024) with LMTP id oeEb5brJKUWi; Sun, 4 Apr 2010 13:23:38 +0200 (CEST) Received: from [10.9.8.1] (chello089173000055.chello.sk [89.173.0.55]) by mail.vx.sk (Postfix) with ESMTPSA id 728A481477; Sun, 4 Apr 2010 13:23:38 +0200 (CEST) Message-ID: <4BB876BA.2030607@FreeBSD.org> Date: Sun, 04 Apr 2010 13:23:38 +0200 From: Martin Matuska User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sk; rv:1.8.1.23) Gecko/20090812 Lightning/0.9 Thunderbird/2.0.0.23 Mnenhy/0.7.5.0 MIME-Version: 1.0 To: Andriy Gapon References: <201003160048.o2G0mReg025652@svn.freebsd.org> <4BB75C8D.8070607@freebsd.org> <4BB75EEF.8060201@freebsd.org> In-Reply-To: <4BB75EEF.8060201@freebsd.org> X-Enigmail-Version: 1.0.1 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: svn-src-head@freebsd.org, Pawel Jakub Dawidek , svn-src-all@freebsd.org, src-committers@freebsd.org, Xin LI Subject: Re: svn commit: r205198 - in head/cddl/contrib/opensolaris: cmd/zfs lib/libzfs/common X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Apr 2010 11:23:42 -0000 The fix is correct. It has been fixed in OpenSolaris rev. 9396. I have filed a PR kern/145377 The PR includes the complete patch from OpenSolaris including their commented code. Link: http://www.freebsd.org/cgi/query-pr.cgi?pr=145377 Dňa 3. 4. 2010 17:29, Andriy Gapon wrote / napísal(a): > on 03/04/2010 18:19 Andriy Gapon said the following: > >> 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. >> >> Relevant code snippet: >> 4286 >> 4287 while (curr) { >> 4288 zfs_prop_t zfs_prop = zfs_name_to_prop(nvpair_name(curr)); >> 4289 nvpair_t *next = nvlist_next_nvpair(zhp->zfs_props, curr); >> 4290 >> 4291 if (props[zfs_prop] == B_FALSE) >> 4292 (void) nvlist_remove(zhp->zfs_props, >> 4293 nvpair_name(curr), nvpair_type(curr)); >> 4294 curr = next; >> 4295 } >> >> zfs_prop is (-1) and nvpair_name(curr) is my custom property "avg:nobackup". >> Not sure if this was fixed in OpenSolaris or what. >> > BTW, I use this simplistic change for time being, not sure if this is a correct fix. > > --- a/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > +++ b/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c > @@ -4288,7 +4288,7 @@ 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) > + if (zfs_prop != ZPROP_INVAL && props[zfs_prop] == B_FALSE) > (void) nvlist_remove(zhp->zfs_props, > nvpair_name(curr), nvpair_type(curr)); > curr = next; > > >