aboutsummaryrefslogtreecommitdiffstats
path: root/cmd/zfs/zfs_iter.c
diff options
context:
space:
mode:
authorTim Chase <[email protected]>2014-04-21 13:22:08 -0500
committerBrian Behlendorf <[email protected]>2014-05-06 10:41:46 -0700
commit962d52421236fc9cd61d59b4f18cff3276077da9 (patch)
tree2e20ebefb0e17c7ff6df4fc797d946934c97d0c9 /cmd/zfs/zfs_iter.c
parent1ce0457348aeb26754ced9b575aa374fcd8dff8b (diff)
Check the dataset type more rigorously when fetching properties.
When fetching property values of snapshots, a check against the head dataset type must be performed. Previously, this additional check was performed only when fetching "version", "normalize", "utf8only" or "case". This caused the ZPL properties "acltype", "exec", "devices", "nbmand", "setuid" and "xattr" to be erroneously displayed with meaningless values for snapshots of volumes. It also did not allow for the display of "volsize" of a snapshot of a volume. This patch adds the headcheck flag paramater to zfs_prop_valid_for_type() and zprop_valid_for_type() to indicate the check is being done against a head dataset's type in order that properties valid only for snapshots are handled correctly. This allows the the head check in get_numeric_property() to be performed when fetching a property for a snapshot. Signed-off-by: Tim Chase <[email protected]> Signed-off-by: Brian Behlendorf <[email protected]> Closes #2265
Diffstat (limited to 'cmd/zfs/zfs_iter.c')
-rw-r--r--cmd/zfs/zfs_iter.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cmd/zfs/zfs_iter.c b/cmd/zfs/zfs_iter.c
index 8892d91f2..eb1d9a54e 100644
--- a/cmd/zfs/zfs_iter.c
+++ b/cmd/zfs/zfs_iter.c
@@ -328,9 +328,9 @@ zfs_sort(const void *larg, const void *rarg, void *data)
rstr = rbuf;
} else {
lvalid = zfs_prop_valid_for_type(psc->sc_prop,
- zfs_get_type(l));
+ zfs_get_type(l), B_FALSE);
rvalid = zfs_prop_valid_for_type(psc->sc_prop,
- zfs_get_type(r));
+ zfs_get_type(r), B_FALSE);
if (lvalid)
(void) zfs_prop_get_numeric(l, psc->sc_prop,