From 962d52421236fc9cd61d59b4f18cff3276077da9 Mon Sep 17 00:00:00 2001 From: Tim Chase Date: Mon, 21 Apr 2014 13:22:08 -0500 Subject: 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 Signed-off-by: Brian Behlendorf Closes #2265 --- include/sys/fs/zfs.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/sys/fs') diff --git a/include/sys/fs/zfs.h b/include/sys/fs/zfs.h index ae72f834d..7b3ae6cff 100644 --- a/include/sys/fs/zfs.h +++ b/include/sys/fs/zfs.h @@ -255,7 +255,7 @@ boolean_t zfs_prop_written(const char *); int zfs_prop_index_to_string(zfs_prop_t, uint64_t, const char **); int zfs_prop_string_to_index(zfs_prop_t, const char *, uint64_t *); uint64_t zfs_prop_random_value(zfs_prop_t, uint64_t seed); -boolean_t zfs_prop_valid_for_type(int, zfs_type_t); +boolean_t zfs_prop_valid_for_type(int, zfs_type_t, boolean_t); /* * Pool property functions shared between libzfs and kernel. -- cgit v1.2.3