]> git.proxmox.com Git - mirror_zfs.git/commit - cmd/zfs/zfs_main.c
Check the dataset type more rigorously when fetching properties.
authorTim Chase <tim@chase2k.com>
Mon, 21 Apr 2014 18:22:08 +0000 (13:22 -0500)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Tue, 6 May 2014 17:41:46 +0000 (10:41 -0700)
commit962d52421236fc9cd61d59b4f18cff3276077da9
tree2e20ebefb0e17c7ff6df4fc797d946934c97d0c9
parent1ce0457348aeb26754ced9b575aa374fcd8dff8b
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 <tim@chase2k.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #2265
cmd/zfs/zfs_iter.c
cmd/zfs/zfs_main.c
include/sys/fs/zfs.h
include/zfs_prop.h
lib/libzfs/libzfs_dataset.c
lib/libzfs/libzfs_mount.c
lib/libzfs/libzfs_util.c
module/zcommon/zfs_prop.c
module/zcommon/zprop_common.c
module/zfs/dsl_prop.c