lsof and ZFS

Vic Abell abe at purdue.edu
Mon Jan 7 07:39:13 PST 2008


Larry,

You write:
>
> On Sat, 5 Jan 2008, Dmitry Morozovsky wrote:
> >
> > The only additional thing I would like to bring attention 
> > at is the fact that
> > ZFS can be used as root, requiring to additionally patch 
> > lsof like FreeSBIE people did for cd9660 root.

I'm not sure about that.  The patch in the cd9660 PR was needed
because lsof couldn't stat(2) the root file system.  I'm not
sure I understand why that is.

What's more, the patch may have unwanted side effects which I
can't determine myself -- e.g., lsof may not be able to convert
kernel device numbers to the user space device numbers returned
by stat(2) and displayed by ls(1).  I've e-mailed the PR author,
asking him to do some testing.

> I believe Vic Abell (the author) is aware of this, although 
> my machines (that he is using for the dev, on RELENG_7), are
> NOT rooted on ZFS, although everything else, except swap, is
> on ZFS.

Yes, Larry, I see that now.  / is UFS.  Some time someone will
have to test the lsof update for ZFS on a system that does have
/ on ZFS.  I won't be able to do that.

I need to warn everyone that the ZFS update for FreeBSD lsof is
going to take a lot of work and time.  Lsof needs the znode
structure definition (and other ZFS structure definitions) that
are defined in the OpenSolaris sources and its header files won't
compile in combination with any FreeBSD header files.  I found
the module compatibility stuff, so I know how to make the
OpenSolaris headers compile, but it will require major
modifications to lsof to be able to do it.

Vic Abell, lsof author



More information about the freebsd-ports mailing list