From owner-svn-src-head@FreeBSD.ORG Thu Apr 25 06:55:58 2013 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 42C2FB7E; Thu, 25 Apr 2013 06:55:58 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 34938121C; Thu, 25 Apr 2013 06:55:58 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.6/8.14.6) with ESMTP id r3P6twUC036631; Thu, 25 Apr 2013 06:55:58 GMT (envelope-from mm@svn.freebsd.org) Received: (from mm@localhost) by svn.freebsd.org (8.14.6/8.14.5/Submit) id r3P6tw1T036630; Thu, 25 Apr 2013 06:55:58 GMT (envelope-from mm@svn.freebsd.org) Message-Id: <201304250655.r3P6tw1T036630@svn.freebsd.org> From: Martin Matuska Date: Thu, 25 Apr 2013 06:55:58 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r249883 - head/cddl/contrib/opensolaris/lib/libzfs/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Apr 2013 06:55:58 -0000 Author: mm Date: Thu Apr 25 06:55:57 2013 New Revision: 249883 URL: http://svnweb.freebsd.org/changeset/base/249883 Log: Respect the enoent_ok flag if reporting error for holding an non-existing snapshot. Related illumos ZFS issue: 3699 zfs hold or release of a non-existent snapshot does not output error Reported by: Steven Hartland MFC after: 3 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 Thu Apr 25 06:29:23 2013 (r249882) +++ head/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Thu Apr 25 06:55:57 2013 (r249883) @@ -4207,10 +4207,13 @@ zfs_hold(zfs_handle_t *zhp, const char * if (nvlist_next_nvpair(ha.nvl, NULL) == NULL) { fnvlist_free(ha.nvl); ret = ENOENT; - (void) snprintf(errbuf, sizeof (errbuf), - dgettext(TEXT_DOMAIN, "cannot hold snapshot '%s@%s'"), - zhp->zfs_name, snapname); - (void) zfs_standard_error(hdl, ret, errbuf); + if (!enoent_ok) { + (void) snprintf(errbuf, sizeof (errbuf), + dgettext(TEXT_DOMAIN, + "cannot hold snapshot '%s@%s'"), + zhp->zfs_name, snapname); + (void) zfs_standard_error(hdl, ret, errbuf); + } return (ret); }