--- kern/vfs_syscalls.c.orig Thu Jan 2 20:26:18 2003 +++ kern/vfs_syscalls.c Tue Jun 24 20:50:03 2003 @@ -980,6 +980,12 @@ return (error); } +#ifdef Z_NFS_EXTENSIONS +static int open_retry_stale = 0; +SYSCTL_INT(_kern, OID_AUTO, open_retry_stale, CTLFLAG_RW, + &open_retry_stale, 0, ""); +#endif + /* * Check permissions, allocate an open file structure, * and call the device open routine if any. @@ -1026,6 +1032,16 @@ */ fhold(fp); error = vn_open(&nd, flags, cmode); +#ifdef Z_NFS_EXTENSIONS + /* + * if the underlying filesystem returns ESTALE + * we must have used a cached file handle. + */ + if ((error == ESTALE) && open_retry_stale) { + NDINIT(&nd, LOOKUP, FOLLOW, UIO_USERSPACE, SCARG(uap, path), p); + error = vn_open(&nd, flags, cmode); + } +#endif if (error) { /* * release our own reference