svn commit: r250016 - stable/9/cddl/contrib/opensolaris/lib/libzfs/common
Martin Matuska
mm at FreeBSD.org
Sun Apr 28 07:48:53 UTC 2013
Author: mm
Date: Sun Apr 28 07:48:53 2013
New Revision: 250016
URL: http://svnweb.freebsd.org/changeset/base/250016
Log:
MFC r249883:
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 <smh at FreeBSD.org>
Modified:
stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
Directory Properties:
stable/9/cddl/contrib/opensolaris/ (props changed)
stable/9/cddl/contrib/opensolaris/lib/libzfs/ (props changed)
Modified: stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c
==============================================================================
--- stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 28 07:00:36 2013 (r250015)
+++ stable/9/cddl/contrib/opensolaris/lib/libzfs/common/libzfs_dataset.c Sun Apr 28 07:48:53 2013 (r250016)
@@ -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);
}
More information about the svn-src-stable-9
mailing list