mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2024-12-26 03:09:34 +03:00
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 - Reviewed by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Igor Kozhukhov <igor@dilos.org> Signed-off-by: Alexander Motin <mav@FreeBSD.org> Closes #8723
This commit is contained in:
parent
97aa3ba44f
commit
4bb40c1c82
@ -240,7 +240,7 @@ zfs_compare(const void *larg, const void *rarg, void *unused)
|
|||||||
*rat = '\0';
|
*rat = '\0';
|
||||||
|
|
||||||
ret = strcmp(lname, rname);
|
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
|
* If we're comparing a dataset to one of its snapshots, we
|
||||||
* always make the full dataset first.
|
* always make the full dataset first.
|
||||||
|
Loading…
Reference in New Issue
Block a user