kernel - Do not invalidate the vnode+children in the NFS core on ESTALE
authorMatthew Dillon <dillon@apollo.backplane.com>
Mon, 29 Jul 2013 22:11:09 +0000 (15:11 -0700)
committerMatthew Dillon <dillon@apollo.backplane.com>
Mon, 29 Jul 2013 22:11:09 +0000 (15:11 -0700)
* When NFS encounters ESTALE it would try to invalidate the related
  namecache topology in the core socket code, requiring an exclusive
  lock on related namecache entries.  This is not compatible with
  shared namecache locking because it can occur as part of any operation,
  even simple GETATTRs.

* Remove the invalidation for now.  The kernel already has a high-level
  solution in place for terminal nodes but we will also need one for
  traversals.

sys/vfs/nfs/nfs_socket.c

index 2ada2f2..61e3da7 100644 (file)
@@ -1508,7 +1508,12 @@ nfs_request_processreply(nfsm_info_t info, int error)
                                return (EAGAIN);        /* goto tryagain */
                        }
 
+#if 0
                        /*
+                        * XXX We can't do this here any more because the
+                        *     caller may be holding a shared lock on the
+                        *     namecache entry.
+                        *
                         * If the File Handle was stale, invalidate the
                         * lookup cache, just in case.
                         *
@@ -1526,6 +1531,7 @@ nfs_request_processreply(nfsm_info_t info, int error)
                                if (ltype == LK_EXCLUSIVE || ltype == LK_SHARED)
                                        lockmgr(&vp->v_lock, ltype);
                        }
+#endif
                        if (nmp->nm_flag & NFSMNT_NFSV3) {
                                KKASSERT(*req->r_mrp == info->mrep);
                                KKASSERT(*req->r_mdp == info->md);