summaryrefslogtreecommitdiff
path: root/sys/nfs/nfs_bio.c
diff options
context:
space:
mode:
authorConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2002-02-08 08:20:50 +0000
committerConstantine Sapuntzakis <csapuntz@cvs.openbsd.org>2002-02-08 08:20:50 +0000
commita25f400aa62632e991663528e26a5426c250d001 (patch)
treeeab2e7f291686c89bc9248e9609741b1072c1d28 /sys/nfs/nfs_bio.c
parent00f6ab81a868e5bae0370ec88fc729c8674ad93b (diff)
There are NFS servers where it's possible to modify a symbolic link. Remove aggressive optimization
Diffstat (limited to 'sys/nfs/nfs_bio.c')
-rw-r--r--sys/nfs/nfs_bio.c32
1 files changed, 13 insertions, 19 deletions
diff --git a/sys/nfs/nfs_bio.c b/sys/nfs/nfs_bio.c
index 8cf96e5f53b..19e870622a1 100644
--- a/sys/nfs/nfs_bio.c
+++ b/sys/nfs/nfs_bio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_bio.c,v 1.34 2002/01/16 21:51:16 ericj Exp $ */
+/* $OpenBSD: nfs_bio.c,v 1.35 2002/02/08 08:20:49 csapuntz Exp $ */
/* $NetBSD: nfs_bio.c,v 1.25.4.2 1996/07/08 20:47:04 jtc Exp $ */
/*
@@ -113,27 +113,21 @@ nfs_bioread(vp, uio, ioflag, cred)
* attributes this could be forced by setting n_attrstamp to 0 before
* the VOP_GETATTR() call.
*/
- /*
- * There is no way to modify a symbolic link via NFS or via
- * VFS, so we don't check if the link was modified
- */
- if (vp->v_type != VLNK) {
- if (np->n_flag & NMODIFIED) {
- np->n_attrstamp = 0;
- error = VOP_GETATTR(vp, &vattr, cred, p);
+ if (np->n_flag & NMODIFIED) {
+ np->n_attrstamp = 0;
+ error = VOP_GETATTR(vp, &vattr, cred, p);
+ if (error)
+ return (error);
+ np->n_mtime = vattr.va_mtime.tv_sec;
+ } else {
+ error = VOP_GETATTR(vp, &vattr, cred, p);
+ if (error)
+ return (error);
+ if (np->n_mtime != vattr.va_mtime.tv_sec) {
+ error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
- } else {
- error = VOP_GETATTR(vp, &vattr, cred, p);
- if (error)
- return (error);
- if (np->n_mtime != vattr.va_mtime.tv_sec) {
- error = nfs_vinvalbuf(vp, V_SAVE, cred, p, 1);
- if (error)
- return (error);
- np->n_mtime = vattr.va_mtime.tv_sec;
- }
}
}