[Bug 261603] sysctl kern.vnode disabled in 2003, can we re-enable now?

From: <bugzilla-noreply_at_freebsd.org>
Date: Mon, 31 Jan 2022 18:03:33 UTC

risner <risner@stdio.com> changed:

           What    |Removed                     |Added
                 CC|                            |risner@stdio.com

--- Comment #2 from risner <risner@stdio.com> ---
Currently lsof in ports can't list pathnames for open zfs files.

The author of the patch to lsof to use FreeBSD abi (sysctl calls) to replace
man of the /dev/kmem reads puts it this way:

"The CTL_KERN + KERN_VNODE sysctl needs to work. Without it we cannot access
the inode ("NODE" column) nor filter by inode or vnode id, nor determine an
open file's filesystem efficiently or sometimes at all (if kinfo_file.kf_path
is empty, then statfs() can't work, whereas we can cache results from previous
statfs() and match by xvnode.xv_mount). There could be further limitations."

If you do lsof with no options it look up all open files belonging to all
active processes. It would use this call to obtain that data or it would obtain
the same by reading kernel memory. The goals is to reduce or eliminate kernel
memory reads by switching to other sources like sysctl calls for the data.

If you need more detail about this, here is the thread:

Also, I may be able to answer more direct questions. But I'm just a motivated
user of lsof wishing to regain features lost in recent FreeBSD release after
the move to OpenZFS.

You are receiving this mail because:
You are the assignee for the bug.