URGENT: [diagnostic] cache_lock: blocked on 0xda5265a8 ""

Matthew Dillon dillon at apollo.backplane.com
Mon Sep 3 18:05:29 PDT 2007


:Yes thats quite right. It also happend when i did the small test and
:umounted the backup drive while still being exported to the clients, the
:clients start getting stuck processes.
:
:petr

    Ok, I was able to reproduce this and I committed a fix to HEAD (but
    not RELEASE yet).  I have also included the patch below so you can
    patch your source tree manually.

    Please test.  The NFS client should now get an error trying to access
    the mount.  Note that once the NFS client gets this error, the client
    must unmount and remount the mount to make things work again because
    the client will be utterly confused and just refuse to mess with that
    mount from that point on.  There isn't much the client can do because
    the real problem here is your server is ripping the filesystem being
    exported out from under the client and suddenly exporting a different
    filesystem (on reboot).

    What you really want to have happen is for the server to NOT export
    that mount point until you've actually inserted the USB stick, which
    would probably require some scripting and messing around with
    /etc/exports at boot time.

    --

    Now the question is whether this fix along with the other one last week
    fixes all of the issues you've reported on this topic or not!  I'm
    crossing my fingers!

					-Matt
					Matthew Dillon 
					<dillon at backplane.com>

Index: nfs_vfsops.c
===================================================================
RCS file: /cvs/src/sys/vfs/nfs/nfs_vfsops.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -p -r1.50 -r1.51
--- nfs_vfsops.c	12 Apr 2007 19:50:19 -0000	1.50
+++ nfs_vfsops.c	4 Sep 2007 00:48:18 -0000	1.51
@@ -1081,19 +1081,32 @@ 	 * Get transfer parameters and root vno
 	 */
 	if ((nmp->nm_state & NFSSTA_GOTFSINFO) == 0) {
 	    if (nmp->nm_flag & NFSMNT_NFSV3) {
-		nfs_fsinfo(nmp, vp, curthread);
+		error = nfs_fsinfo(nmp, vp, curthread);
 		mp->mnt_stat.f_iosize = nfs_iosize(1, nmp->nm_sotype);
 	    } else {
 		if ((error = VOP_GETATTR(vp, &attrs)) == 0)
 			nmp->nm_state |= NFSSTA_GOTFSINFO;
 		
 	    }
+	} else {
+	    /*
+	     * The root vnode is usually cached by the namecache so do not
+	     * try to avoid going over the wire even if we have previous
+	     * information cached.  A stale NFS mount can loop
+	     * forever resolving the root vnode if we return no-error when
+	     * there is in fact an error.
+	     */
+	    np->n_attrstamp = 0;
+	    error = VOP_GETATTR(vp, &attrs);
 	}
 	if (vp->v_type == VNON)
 	    nfs_setvtype(vp, VDIR);
 	vp->v_flag = VROOT;
-	*vpp = vp;
-	return (0);
+	if (error)
+		vput(vp);
+	else
+		*vpp = vp;
+	return (error);
 }
 
 extern int syncprt;





More information about the Kernel mailing list