NFSv234 problems

rick at snowhite.cis.uoguelph.ca rick at snowhite.cis.uoguelph.ca
Sun Jul 31 20:37:12 GMT 2005


Well, yah got me pretty good. (I had built a kernel with NFSCLIENT and
DEBUG_VFS_LOCKS for FreeBSD5.4. Not so for FreeBSD6.0-BETA1.:-)

Here's some specifics:
> How does one configure the kernel as an NFS client?  The kernel
> doesn't link when you define both
> 
> options NFSD
> options NFSCLIENT
> 
> newnfs_port.o(.data+0x400): In function `nfsrvd_rcv':
> =2E./../../newnfs/nfs/newnfs_port.c:228: multiple definition of `M_NFSLOCK'
> nfs_lock.o(.data+0x0):../../../nfsclient/nfs_lock.c:81: first defined here
> *** Error code 1

M_NFSLOCK needs to be renamed. I've put a simple patch in
ftp://ftp.cis.uoguelph.ca/pub/nfsv4/patch1-freebsd6.0-beta1.diffc, but I think
I'll be creating new tarballs for FreeBSD6.0-BETA1 soon, that will have all the
server specific M_NFSxxx renamed to M_NFSDxxx.
(I need to do this after I fix problems that DEBUG_VFS_LOCKS finds. I suspect
 your crash is one of them:-)

> Also the utilities don't build properly out of the box..they need an
> -I to point to the headers (or there needs to be a patch to make the
> headers get installed by 'make includes'), and 'make install' doesn't
> work once you fix that.

There's a file called Install.notes in doc.tar.gz which I think covers
the steps involved in a manual install. But you are definitely correct
that these things need to be fixed up as a part of integrating it. I
just heard this weekend that the FreeBSD folks might be interested in doing
that now.

I think the best route would be to integrate the V4 stuff into FreeBSD's
current mountd/nfsd in such a way that the utilities will work for both
nfs servers, depending upon which one is configured in the kernel.
(Even if making ones that work with both isn't practical, integrating the
 V4 stuff into your current code is a good idea, since the ones in
 nfsv4utils are based on really old code, except for the V4 extensions.)

> haessal# mount_nfs4 dosirak:/c /dosirak/c
> mount_nfs4: /dosirak/c: Protocol not supported

My guess on this is that your /etc/newexports doesn't have the V4 section
added to it. Another possibility is that the FreeBSD client only knows how
to mount "/" for V4. (I admit I've done very little testing with the
FreeBSD client, since I've never gotten it to work well. See Clients.notes
int doc.tar.gz.)

> (nothing logged on the server), and the mount_newnfs in the utils
> tarball does not compile on FreeBSD.

The client only works with OpenBSD3.7 and that's what uses mount_newnfs.
(It is different code than the CITI client in FreeBSD.)

> It died after a few seconds with:
> 
> panic: lockmgr: thread 0xc5aea000, not exclusive lock holder 0xc5ab0d80 unl=
> ocking
> db> wh
> Tracing pid 54836 tid 100188 td 0xc5aea000
> kdb_enter(c06feb5a,1,c06fd00e,f7c86980,c5aea000) at kdb_enter+0x30
> panic(c06fd00e,c5aea000,c06fcff8,c5ab0d80,c5aea000) at panic+0x13e
> debuglockmgr(c62f8b2c,6,c62f8b6c,c5aea000,c06f8111) at debuglockmgr+0x59e
> vop_stdunlock(f7c86a24,f7c86a34,786,c5b2b400,c5bac0ba) at vop_stdunlock+0x4d
> VOP_UNLOCK_APV(c0749660,f7c86a24,2,f7c86a10,c06d6282) at VOP_UNLOCK_APV+0xb2
> nfsrv_namei(c9d8de80,f7c86b7c,c62f8ad4,0,180) at nfsrv_namei+0x46b
> nfsrvd_lookup(c9d8de80,c9bf4880,c62f8ad4,0,f7c86c1c) at nfsrvd_lookup+0xcf
> nfsrvd_dorpc(c9d8de80,c9bf4880,c5aea000,6e5,0) at nfsrvd_dorpc+0x2f3
> nfsrvd_nfsd(c5aea000,0,c070d4cc,33d,c5ae2cb0) at nfsrvd_nfsd+0x404
> nfssvc(c5aea000,f7c86d04,8,bfbff000,2) at nfssvc+0x3a8
> syscall(2806003b,2806003b,bfbf003b,2804f40b,bfbfe884) at syscall+0x295
> Xint0x80_syscall() at Xint0x80_syscall+0x1f
> --- syscall (155, FreeBSD ELF32, nfssvc), eip =3D 0x280ba523, esp =3D 0xbfb=
> fe64c, ebp =3D 0xbfbfe848 ---
> db>

Blush. I never noticed that my config for FreeBSD6-BETA1 didn't have
DEBUG_VFS_LOCKS defined in it. This may keep me busy for a little while
and I think I'll create new tarballs once I think it's fixed (I'm just
ansifying all the function headers and doing some cleanup, as well).

If you want to test in the meantime, take "options DEBUG_VFS_LOCKS" out
of your config and I think it will be much happier.

Thanks for the testing, rick


More information about the freebsd-fs mailing list