ZFS, procfs and java
Stephane E. Potvin
sepotvin at FreeBSD.org
Sat Apr 21 14:43:47 UTC 2007
-----BEGIN PGP SIGNED MESSAGE-----
Robert Watson wrote:
> On Fri, 20 Apr 2007, Stephane E. Potvin wrote:
>> It seems that the ZFS cache (dnlc) doesn't update the VSF_namecache
>> fields in the vnodes (v_cache_src, v_cache_dst and v_dd). This
>> unfortunately causes the file link in /proc/curproc to return
>> "unknown" as it uses vn_fullpath which relies on the namecache fields
>> to be set correctly.
>> Java uses /proc/curproc/file to know where to find its libraries and
>> doesn't expect the "unknown" return value returned when using ZFS (due
>> to vn_fullpath failing). The attached patches to the java/jdk15 port
>> fixes this issue but it doesn't fix the root of the problem.
>> Would it be possible to add support in dnlc for updating the VFS
>> namecache fields or to add knowledge of dnlc into vn_fullpath?
> No application should rely on the correctness and usefulness of
> /proc/curproc/file -- the conversion from a vnode to a pathname is
> inherently unreliable. Likewise, properly ported applications should
> not rely on the availability of procfs, as its use is deprecated. My
> advice would be to talk to the Java porters about entirely eliminating
> this dependency.
> As a matter of debugging/logging convenience, it would be nice if ZFS
> implemented the name cache hooks, since using vn_fullpath is useful for
> procfs monitoring of process address space, audit, etc.
Thanks Robert, you expressed far better than me what I was trying to
express :) Indeed, the problem with java is that it doesn't check the
"return value" of reading /proc/curproc/file for an error ("unknown"
link name in that case). If procfs is not mounted then java works as
expected. The patch that I attached with my original message fixes that
problem. I was more wondering what would be the better way to fix
vn_fullpath failures in the presence of ZFS for debugging/logging
convenience, as you put it.
After sleeping on that, I'm wondering if it would be better for procfs
to not create the "file" link if vn_fullpath fails instead of creating
one with "unknown"? This could probably cause applications to
automatically revert as if procfs had not been mounted in most cases if
they don't check for the magic "unknown" link name.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (FreeBSD)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the freebsd-current