NFS Locking Issue

Kostik Belousov kostikbel at gmail.com
Mon Jul 3 04:20:19 UTC 2006


On Sun, Jul 02, 2006 at 05:49:44PM -0400, Francisco Reyes wrote:
> User Freebsd writes:
> 
> >Since there are several of us experiencing what looks to be the same sort 
> >of deadlock issue, I beseech you not to give up
> 
> I will try to setup the environment, but to be honest no more 6.X for us 
> until 6.2 or 6.3.. We have lost clients already.
I think that then 6.2 and 6.3 is not for you either. Problems
cannot be fixed until enough information is given. Since nobody
except you experience that problems (at least, only you notified
about the problem existence), no bug reports with sufficient
information is given.
> 
> >Is this a problem that you can easily recreate
> 
> There is one thing I can easily recreate that would very helpfull to solve.
> The 6.X NFS clients freeze if the NFS server goes away.
> 
> I have been able to reproduce that every single time.. both in test and 
> production.
Is this for intr mounts ? I posted some time ago the patches that
improved handling of signals in nfs client. If you could test it, that
would be useful.


? sys/nfsclient/.arch-ids
Index: sys/nfsclient/nfs_socket.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/sys/nfsclient/nfs_socket.c,v
retrieving revision 1.141
diff -u -r1.141 nfs_socket.c
--- sys/nfsclient/nfs_socket.c	23 May 2006 18:33:58 -0000	1.141
+++ sys/nfsclient/nfs_socket.c	3 Jul 2006 04:19:23 -0000
@@ -1701,11 +1701,13 @@
 	p = td->td_proc;
 	PROC_LOCK(p);
 	tmpset = p->p_siglist;
+	SIGSETOR(tmpset, td->td_siglist);
 	SIGSETNAND(tmpset, td->td_sigmask);
 	mtx_lock(&p->p_sigacts->ps_mtx);
 	SIGSETNAND(tmpset, p->p_sigacts->ps_sigignore);
 	mtx_unlock(&p->p_sigacts->ps_mtx);
-	if (SIGNOTEMPTY(p->p_siglist) && nfs_sig_pending(tmpset)) {
+	if ((SIGNOTEMPTY(p->p_siglist) || SIGNOTEMPTY(td->td_siglist))
+	    && nfs_sig_pending(tmpset)) {
 		PROC_UNLOCK(p);
 		return (EINTR);
 	}
Index: sys/nfsclient/nfs_vnops.c
===================================================================
RCS file: /usr/local/arch/ncvs/src/sys/nfsclient/nfs_vnops.c,v
retrieving revision 1.266
diff -u -r1.266 nfs_vnops.c
--- sys/nfsclient/nfs_vnops.c	19 May 2006 00:04:24 -0000	1.266
+++ sys/nfsclient/nfs_vnops.c	3 Jul 2006 04:19:24 -0000
@@ -2716,7 +2716,7 @@
 	 * otherwise just do it ourselves.
 	 */
 	if ((bp->b_flags & B_ASYNC) == 0 ||
-	    nfs_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, td))
+	    nfs_asyncio(VFSTONFS(ap->a_vp->v_mount), bp, NOCRED, curthread))
 		(void)nfs_doio(ap->a_vp, bp, cr, td);
 	return (0);
 }
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20060703/82fe380b/attachment.pgp


More information about the freebsd-stable mailing list