From 7fec46b9d8967109ad289d208e8cf36a0c16e40c Mon Sep 17 00:00:00 2001 From: Alexander Eremin Date: Wed, 13 May 2015 15:15:56 -0700 Subject: Illumos 5847 - libzfs_diff should check zfs_prop_get() return 5847 libzfs_diff should check zfs_prop_get() return Reviewed by: Matthew Ahrens Reviewed by: Albert Lee Approved by: Dan McDonald References: https://www.illumos.org/issues/5847 https://github.com/illumos/illumos-gate/commit/8430278 Ported-by: Brian Behlendorf Closes #3412 --- lib/libzfs/libzfs_diff.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'lib/libzfs/libzfs_diff.c') diff --git a/lib/libzfs/libzfs_diff.c b/lib/libzfs/libzfs_diff.c index 7472d246b..ea37285fe 100644 --- a/lib/libzfs/libzfs_diff.c +++ b/lib/libzfs/libzfs_diff.c @@ -21,6 +21,7 @@ /* * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright 2015 Nexenta Systems, Inc. All rights reserved. */ /* @@ -620,9 +621,12 @@ get_snapshot_names(differ_info_t *di, const char *fromsnap, zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM); while (zhp != NULL) { - (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN, - origin, sizeof (origin), &src, NULL, 0, B_FALSE); - + if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin, + sizeof (origin), &src, NULL, 0, B_FALSE) != 0) { + (void) zfs_close(zhp); + zhp = NULL; + break; + } if (strncmp(origin, fromsnap, fsnlen) == 0) break; -- cgit v1.2.3