mirror of
https://git.proxmox.com/git/mirror_zfs.git
synced 2026-05-22 10:37:35 +03:00
Do not print UINT64_MAX value for some of zfs properties
The values of next properties: filesystem_limit, filesystem_count, snapshot_limit, snapshot_count were returned to user as UINT64_MAX integers in case if -p cli option is used, return 'none' value instead. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Fedor Uporov <fuporov.vstack@gmail.com> Closes #9306 Closes #12690
This commit is contained in:
@@ -2767,16 +2767,15 @@ zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
|
||||
return (-1);
|
||||
|
||||
/*
|
||||
* If limit is UINT64_MAX, we translate this into 'none' (unless
|
||||
* literal is set), and indicate that it's the default value.
|
||||
* Otherwise, we print the number nicely and indicate that it's
|
||||
* set locally.
|
||||
* If limit is UINT64_MAX, we translate this into 'none', and
|
||||
* indicate that it's the default value. Otherwise, we print
|
||||
* the number nicely and indicate that it's set locally.
|
||||
*/
|
||||
if (literal) {
|
||||
if (val == UINT64_MAX) {
|
||||
(void) strlcpy(propbuf, "none", proplen);
|
||||
} else if (literal) {
|
||||
(void) snprintf(propbuf, proplen, "%llu",
|
||||
(u_longlong_t)val);
|
||||
} else if (val == UINT64_MAX) {
|
||||
(void) strlcpy(propbuf, "none", proplen);
|
||||
} else {
|
||||
zfs_nicenum(val, propbuf, proplen);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user