Bug 194117 - libprocstat incorrectly extracts some ZFS information
Summary: libprocstat incorrectly extracts some ZFS information
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-bugs mailing list
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-10-03 15:31 UTC by Andriy Gapon
Modified: 2015-03-07 13:52 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andriy Gapon freebsd_committer 2014-10-03 15:31:33 UTC
lib/libprocstat/zfs.c uses old ZFS znode_t layout that is not compatible with what is currently in kernel when it extracts vn_mode and vn_size.  In particular, the code assumes that znode_t contains a pointer to a znode_phys_t object, which is not the case.

I think that the required information can be extracted from z_size and z_mode fields in znode_t.

While here, there is a comment in zfs_filestat() that talks about two byte offsets, while in reality the offsets are 2 * sizeof(pointer), e.g. 16 bytes on 64-bit systems.  The code itself is correct.