Bug 253553 - sysutils/lsof: no zfs support on 13
Summary: sysutils/lsof: no zfs support on 13
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Larry Rosenman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-16 10:24 UTC by Mathieu Arnold
Modified: 2022-08-02 22:23 UTC (History)
18 users (show)

See Also:
bugzilla: maintainer-feedback? (ler)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mathieu Arnold freebsd_committer 2021-02-16 10:24:43 UTC
I upgraded our package builder machine to 13.0-BETA2 to prepare our first 13.0 deployments, and when I tried to look at something, I got this:

# lsof -p 43535
lsof: WARNING: no ZFS support has been defined.
      See 00FAQ for more information.
COMMAND   PID USER   FD   TYPE DEVICE  SIZE/OFF NODE NAME
find    43535 root    0u  VCHR  0,181 0t3109790  181 /dev/pts/2
find    43535 root    1u  VCHR  0,181 0t3109790  181 /dev/pts/2
find    43535 root    2u  VCHR  0,181 0t3109790  181 /dev/pts/2
find    43535 root    3r                             unknown file system type: zfs
find    43535 root    4r                             unknown file system type: zfs
find    43535 root    5r                             unknown file system type: zfs

I had a look at 00FAQ, but it is way beyond me.
Comment 1 Raivo Hool 2021-03-03 22:36:23 UTC
Lsof looks for zfs_znode.h to determine whether to build ZFS support. Said file has moved from the contrib/opensolaris directory to contrib/openzfs etc., and since #include paths are hard coded in Configure, it doesn't get picked up, and the support isn't included. I tried playing around with it a bit today, but encountered include escalation and put it on hold. Include paths are set in the Makefile, but there are too many files in different subdirectories with identical names that get referenced that it was not immediately apparent which need to be included and which do not.
Comment 2 ggulchin 2021-05-01 06:11:31 UTC
And progress on this? 
thanks in advance
Comment 3 Matthias Andree freebsd_committer 2021-05-18 20:16:57 UTC
Also, I would propose to install 00FAQ as a documentation file.
Comment 4 Graham Perrin 2021-06-03 16:03:48 UTC
Workaround, thanks to covacat at 
<https://forums.FreeBSD.org/threads/80511/post-515499>: 

sh -c "ps ax -o pid= | xargs procstat -f 2>/dev/null"
Comment 5 Mathieu Arnold freebsd_committer 2021-10-07 20:53:15 UTC
Any update on this?
Comment 6 Larry Rosenman freebsd_committer 2021-10-07 20:56:01 UTC
I need the Kernel/FS guys to look at it.
Comment 7 Larry Rosenman freebsd_committer 2021-10-07 20:57:01 UTC
this also (Obviously) applies to 14 as well.
Comment 8 Graham Perrin 2021-12-18 16:21:21 UTC
<https://github.com/lsof-org/lsof/pull/184>

> Use user mode APIs on FreeBSD by DamjanJovanovic · Pull Request 
> #184 · lsof-org/lsof

– in particular: 

> …
> 
> Portability: the flagship platform is FreeBSD 13, where development 
> and most testing was done. …
Comment 9 risner 2022-01-25 15:13:03 UTC
Is this still being considered?

The current package lsof-4.94.0,8 still reports:
"unknown file system type: zfs"
errors.

Could the port maintainer possibly integrate this patch for the port until it's merged into lsof master?
Comment 10 Larry Rosenman freebsd_committer 2022-01-25 15:14:57 UTC
Yes, we're waiting on completion of:
https://github.com/lsof-org/lsof/pull/180
Comment 11 risner 2022-01-25 15:37:49 UTC
I think DamjanJovanovic closed 180 and opened 184:
https://github.com/lsof-org/lsof/pull/184

It's still not completed tho.
Comment 12 Larry Rosenman freebsd_committer 2022-01-25 15:56:28 UTC
Yeah -- my mistake.
Comment 13 risner 2022-01-25 17:17:44 UTC
For now, anyone wishing to use DamjanJovanovic's version on FreeBSD can use this port file:
https://github.com/risner/freebsd_lsof
Comment 14 Graham Perrin 2022-01-25 23:00:03 UTC
(In reply to risner from comment #13)

<https://github.com/risner/freebsd_lsof/issues/1>

> * reading xvnode list failed: No such file or directory
> 
> * please, am I missing something?
Comment 15 risner 2022-01-31 12:36:53 UTC
Currently the lsof team is waiting for FreeBSD to re-enable the kern.vnode sysctl disabled in 2003 with commit acb18acfec97aa7fe26ff48f80a5c3f89c9b542d.

The FreeBSD ports patch to support usermode is waiting waiting on the lsof team to merge the ABI change pull request.

The warning is a reminder it failed on kern.vnode and had to fall back to reading /dev/kmem to get inode information (see NODE column):
root@plot:isner # lsof /dev/gpt/slot_B12
lsof: WARNING: compiled for FreeBSD release 13.0-RELEASE-p3; this is 13.0-RELEASE.
lsof: WARNING -- reading xvnode list failed: No such file or directory
COMMAND   PID USER   FD   TYPE DEVICE  SIZE/OFF NODE NAME
dd      48721 root    3r  VCHR   1,32 0x72c8200  288 /dev/gpt/slot_B12

More info available here: https://github.com/lsof-org/lsof/pull/184#issuecomment-1023556335

So both of use (FreeBSD ports and lsof team) are waiting on an action by the other. If you need this working in FreeBSD now, my temporary port works for ZFS files.