Date: Mon, 18 Dec 2006 16:20:21 GMT From: Ulrich Spoerlein <uspoerlein@gmail.com> To: freebsd-bugs@FreeBSD.org Subject: Re: kern/92785: Using exported filesystem on OS/2 NFS client causes filesystem freeze Message-ID: <200612181620.kBIGKLBn030373@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/92785; it has been noted by GNATS. From: Ulrich Spoerlein <uspoerlein@gmail.com> To: Konstantin Belousov <kostikbel@gmail.com> Cc: bug-followup@freebsd.org Subject: Re: kern/92785: Using exported filesystem on OS/2 NFS client causes filesystem freeze Date: Mon, 18 Dec 2006 16:08:34 +0100 Konstantin Belousov wrote: > Try this (not ever booted kernel with this patch applied, beware). > > Index: ufs/ufs/ufs_lookup.c > =================================================================== > RCS file: /usr/local/arch/ncvs/src/sys/ufs/ufs/ufs_lookup.c,v > retrieving revision 1.82 > diff -u -r1.82 ufs_lookup.c > --- ufs/ufs/ufs_lookup.c 31 Jul 2006 15:44:13 -0000 1.82 > +++ ufs/ufs/ufs_lookup.c 15 Dec 2006 15:42:43 -0000 > @@ -556,7 +553,10 @@ > * that point backwards in the directory structure. > */ > pdp = vdp; > - if (flags & ISDOTDOT) { > + if (dp->i_number == dp->i_ino) { > + VREF(vdp); /* we want ourself, ie "." */ > + *vpp = vdp; > + } else if (flags & ISDOTDOT) { > saved_ino = dp->i_ino; > VOP_UNLOCK(pdp, 0, td); /* race to get the inode */ > error = VFS_VGET(pdp->v_mount, saved_ino, > @@ -565,9 +565,6 @@ > if (error) > return (error); > *vpp = tdp; > - } else if (dp->i_number == dp->i_ino) { > - VREF(vdp); /* we want ourself, ie "." */ > - *vpp = vdp; > } else { > error = VFS_VGET(pdp->v_mount, dp->i_ino, > cnp->cn_lkflags, &tdp); I had a colleague of mine test this while instructing him over the phone and it seems to fix the problem. No deadlocks, no leaks, the OS/2 clients can mount/ls/umount at will. All seems well. Extensive tests have NOT yet been done. I'm also a little uneasy, as the patch changes code that has been there since revision 1.1. I wonder how 4.x managed these OS/2 clients. Perhaps the old nfsd/rpc code rejected these bogus lookups? Anyway, thank you very much for the patch, we will be running it on our server base shortly. Ulrich Spoerlein PS: Since this fix is UFS specific, what's with the other filesystems that can be NFS exported? I think I'll do some test with ext2fs or msdosfs exported filesystems next week.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200612181620.kBIGKLBn030373>