summaryrefslogtreecommitdiffstats
path: root/sys/nfsclient/nfs_bio.c
diff options
context:
space:
mode:
authorpeadar <peadar@FreeBSD.org>2004-04-14 23:23:55 +0000
committerpeadar <peadar@FreeBSD.org>2004-04-14 23:23:55 +0000
commit5617193e919f277fdd23876b7881da9cc75b6a5b (patch)
tree4f111d425a38413a4e757a89c1dc965f103c6244 /sys/nfsclient/nfs_bio.c
parent185be4df7ac473452a43a3b4c8d2ab01c7f626b4 (diff)
downloadFreeBSD-src-5617193e919f277fdd23876b7881da9cc75b6a5b.zip
FreeBSD-src-5617193e919f277fdd23876b7881da9cc75b6a5b.tar.gz
Let the NFS client notice a file's size changing as a modification.
This avoids presenting invalid data to the client's applications when the file is modified, and then extended within the window of the resolution of the modifcation timestamp. Reviewed By: iedowse PR: kern/64091
Diffstat (limited to 'sys/nfsclient/nfs_bio.c')
-rw-r--r--sys/nfsclient/nfs_bio.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/nfsclient/nfs_bio.c b/sys/nfsclient/nfs_bio.c
index 6866103..7df0531 100644
--- a/sys/nfsclient/nfs_bio.c
+++ b/sys/nfsclient/nfs_bio.c
@@ -432,13 +432,15 @@ nfs_bioread(struct vnode *vp, struct uio *uio, int ioflag, struct ucred *cred)
error = VOP_GETATTR(vp, &vattr, cred, td);
if (error)
return (error);
- if (np->n_mtime != vattr.va_mtime.tv_sec) {
+ if ((np->n_flag & NSIZECHANGED)
+ || (np->n_mtime != vattr.va_mtime.tv_sec)) {
if (vp->v_type == VDIR)
(nmp->nm_rpcops->nr_invaldir)(vp);
error = nfs_vinvalbuf(vp, V_SAVE, cred, td, 1);
if (error)
return (error);
np->n_mtime = vattr.va_mtime.tv_sec;
+ np->n_flag &= ~NSIZECHANGED;
}
}
do {
OpenPOWER on IntegriCloud