diff options
author | alc <alc@FreeBSD.org> | 2011-02-05 21:21:27 +0000 |
---|---|---|
committer | alc <alc@FreeBSD.org> | 2011-02-05 21:21:27 +0000 |
commit | 11491a4c5e318059ea9051b6523ce066255020e4 (patch) | |
tree | 17ca053f5237cdf00df048613ae24ad00ba77d0e /sys/fs/nfsserver | |
parent | 0410b9c4fd31dc29ce008f99b4f751d2a0dc37fe (diff) | |
download | FreeBSD-src-11491a4c5e318059ea9051b6523ce066255020e4.zip FreeBSD-src-11491a4c5e318059ea9051b6523ce066255020e4.tar.gz |
Unless "cnt" exceeds MAX_COMMIT_COUNT, nfsrv_commit() and nfsvno_fsync() are
incorrectly calling vm_object_page_clean(). They are passing the length of
the range rather than the ending offset of the range.
Perform the OFF_TO_IDX() conversion in vm_object_page_clean() rather than the
callers.
Reviewed by: kib
MFC after: 3 weeks
Diffstat (limited to 'sys/fs/nfsserver')
-rw-r--r-- | sys/fs/nfsserver/nfs_nfsdport.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/fs/nfsserver/nfs_nfsdport.c b/sys/fs/nfsserver/nfs_nfsdport.c index 035212f..ab04ff0 100644 --- a/sys/fs/nfsserver/nfs_nfsdport.c +++ b/sys/fs/nfsserver/nfs_nfsdport.c @@ -1225,7 +1225,8 @@ nfsvno_fsync(struct vnode *vp, u_int64_t off, int cnt, struct ucred *cred, if (vp->v_object && (vp->v_object->flags & OBJ_MIGHTBEDIRTY)) { VM_OBJECT_LOCK(vp->v_object); - vm_object_page_clean(vp->v_object, off / PAGE_SIZE, (cnt + PAGE_MASK) / PAGE_SIZE, OBJPC_SYNC); + vm_object_page_clean(vp->v_object, off, off + cnt, + OBJPC_SYNC); VM_OBJECT_UNLOCK(vp->v_object); } |