summaryrefslogtreecommitdiffstats
path: root/lib/libzfs
diff options
context:
space:
mode:
authorAlexander Eremin <[email protected]>2015-05-13 15:15:56 -0700
committerBrian Behlendorf <[email protected]>2015-05-15 11:17:14 -0700
commit7fec46b9d8967109ad289d208e8cf36a0c16e40c (patch)
tree65067f53ba03f4b280b0a1c6774845b0c51bd040 /lib/libzfs
parente5fd1dd6820d6ebca470990e433dfa9f60afc5f7 (diff)
Illumos 5847 - libzfs_diff should check zfs_prop_get() return
5847 libzfs_diff should check zfs_prop_get() return Reviewed by: Matthew Ahrens <[email protected]> Reviewed by: Albert Lee <[email protected]> Approved by: Dan McDonald <[email protected]> References: https://www.illumos.org/issues/5847 https://github.com/illumos/illumos-gate/commit/8430278 Ported-by: Brian Behlendorf <[email protected]> Closes #3412
Diffstat (limited to 'lib/libzfs')
-rw-r--r--lib/libzfs/libzfs_diff.c10
1 files changed, 7 insertions, 3 deletions
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;