Various NFS fixes:
Make vfs_bio buffer mgmt work better. Buffers were being used after brelse. Make nfs_getpages work independently of other NFS interfaces. This eliminates some difficult recursion problems and decreases pagefault overhead. Remove an erroneous vfs_unbusy_pages. Fix a reentrancy problem, with nfs_vinvalbuf when vnode is already being rundown. Reassignbuf wasn't being called when needed under certain circumstances. (Thanks for help from Bill Paul.)
This commit is contained in:
parent
bed196b4e2
commit
8447a0aed7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=32754
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.74 1997/12/29 00:23:41 dyson Exp $
|
||||
* $Id: nfs_vnops.c,v 1.75 1998/01/08 23:42:03 eivind Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -403,38 +403,44 @@ nfs_open(ap)
|
||||
error = nqnfs_getlease(vp, ND_READ, ap->a_cred,
|
||||
ap->a_p);
|
||||
} while (error == NQNFS_EXPIRED);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
if (np->n_lrev != np->n_brev ||
|
||||
(np->n_flag & NQNFSNONCACHE)) {
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
|
||||
ap->a_p, 1)) == EINTR)
|
||||
ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_brev = np->n_lrev;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (np->n_flag & NMODIFIED) {
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
|
||||
ap->a_p, 1)) == EINTR)
|
||||
ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_attrstamp = 0;
|
||||
if (vp->v_type == VDIR)
|
||||
np->n_direofoffset = 0;
|
||||
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
np->n_mtime = vattr.va_mtime.tv_sec;
|
||||
} else {
|
||||
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
if (np->n_mtime != vattr.va_mtime.tv_sec) {
|
||||
if (vp->v_type == VDIR)
|
||||
np->n_direofoffset = 0;
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE,
|
||||
ap->a_cred, ap->a_p, 1)) == EINTR)
|
||||
ap->a_cred, ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_mtime = vattr.va_mtime.tv_sec;
|
||||
}
|
||||
}
|
||||
|
@ -34,7 +34,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)nfs_vnops.c 8.16 (Berkeley) 5/27/95
|
||||
* $Id: nfs_vnops.c,v 1.74 1997/12/29 00:23:41 dyson Exp $
|
||||
* $Id: nfs_vnops.c,v 1.75 1998/01/08 23:42:03 eivind Exp $
|
||||
*/
|
||||
|
||||
|
||||
@ -403,38 +403,44 @@ nfs_open(ap)
|
||||
error = nqnfs_getlease(vp, ND_READ, ap->a_cred,
|
||||
ap->a_p);
|
||||
} while (error == NQNFS_EXPIRED);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
if (np->n_lrev != np->n_brev ||
|
||||
(np->n_flag & NQNFSNONCACHE)) {
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
|
||||
ap->a_p, 1)) == EINTR)
|
||||
ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_brev = np->n_lrev;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (np->n_flag & NMODIFIED) {
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE, ap->a_cred,
|
||||
ap->a_p, 1)) == EINTR)
|
||||
ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_attrstamp = 0;
|
||||
if (vp->v_type == VDIR)
|
||||
np->n_direofoffset = 0;
|
||||
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
np->n_mtime = vattr.va_mtime.tv_sec;
|
||||
} else {
|
||||
error = VOP_GETATTR(vp, &vattr, ap->a_cred, ap->a_p);
|
||||
if (error)
|
||||
if (error) {
|
||||
return (error);
|
||||
}
|
||||
if (np->n_mtime != vattr.va_mtime.tv_sec) {
|
||||
if (vp->v_type == VDIR)
|
||||
np->n_direofoffset = 0;
|
||||
if ((error = nfs_vinvalbuf(vp, V_SAVE,
|
||||
ap->a_cred, ap->a_p, 1)) == EINTR)
|
||||
ap->a_cred, ap->a_p, 1)) == EINTR) {
|
||||
return (error);
|
||||
}
|
||||
np->n_mtime = vattr.va_mtime.tv_sec;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user