path: root/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
diff options
authorAlexander Motin <mav@FreeBSD.org>2019-05-08 01:35:43 +0000
committerAlexander Motin <mav@FreeBSD.org>2019-05-08 01:35:43 +0000
commitd044b69950ed6ac292a3fd96323cfe5d81baf0f5 (patch)
tree3a81a995a4298edc60e4a4578761f99481642149 /cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
parent2cb54a800c3a42cc256adcda0be98bd0af39096c (diff)
Fix dataset name comparison in zfs_compare().
The code never returned match comparing two datasets (not snapshots). As result, uu_avl_find(), called from zfs_callback(), never succeeded, allowing to add same dataset into the list multiple times, for example: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers name pers - pers@z name pers@z - With the patch: # zfs get name pers pers pers@z pers@z NAME PROPERTY VALUE SOURCE pers name pers - pers@z name pers@z - MFC after: 1 week Sponsored by: iXsystems, Inc.
Notes: svn path=/head/; revision=347240
Diffstat (limited to 'cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c')
1 files changed, 1 insertions, 1 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
index e32748d2909b..90815813f8ce 100644
--- a/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
+++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_iter.c
@@ -225,7 +225,7 @@ zfs_compare(const void *larg, const void *rarg, void *unused)
*rat = '\0';
ret = strcmp(lname, rname);
- if (ret == 0) {
+ if (ret == 0 && (lat != NULL || rat != NULL)) {
* If we're comparing a dataset to one of its snapshots, we
* always make the full dataset first.