mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 18:40:43 +03:00
zfs get -p only outputs 3 columns if "clones" property is empty
get_clones_string currently returns an empty string for filesystem snapshots which have no clones. This breaks parsable `zfs get` output as only three columns are output, instead of 4. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Fiddaman <github@m.fiddaman.uk> Co-authored-by: matt <matt@fiddaman.net> Closes #11837
This commit is contained in:
committed by
Brian Behlendorf
parent
71a3487a89
commit
1bb4b5a5ae
@@ -32,6 +32,7 @@
|
||||
* Copyright 2017-2018 RackTop Systems.
|
||||
* Copyright (c) 2019 Datto Inc.
|
||||
* Copyright (c) 2019, loli10K <ezomori.nozomu@gmail.com>
|
||||
* Copyright (c) 2021 Matt Fiddaman
|
||||
*/
|
||||
|
||||
#include <ctype.h>
|
||||
@@ -2385,7 +2386,7 @@ get_clones_string(zfs_handle_t *zhp, char *propbuf, size_t proplen)
|
||||
nvpair_t *pair;
|
||||
|
||||
value = zfs_get_clones_nvl(zhp);
|
||||
if (value == NULL)
|
||||
if (value == NULL || nvlist_empty(value))
|
||||
return (-1);
|
||||
|
||||
propbuf[0] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user