svn commit: r213924 -
stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs
Andriy Gapon
avg at FreeBSD.org
Sat Oct 16 11:52:44 UTC 2010
Author: avg
Date: Sat Oct 16 11:52:43 2010
New Revision: 213924
URL: http://svn.freebsd.org/changeset/base/213924
Log:
MFC r213730: zfs + sendfile: do not produce partially valid pages for
vnode's tail
Modified:
stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
Directory Properties:
stable/8/sys/ (props changed)
stable/8/sys/amd64/include/xen/ (props changed)
stable/8/sys/cddl/contrib/opensolaris/ (props changed)
stable/8/sys/contrib/dev/acpica/ (props changed)
stable/8/sys/contrib/pf/ (props changed)
stable/8/sys/dev/xen/xenpci/ (props changed)
Modified: stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c
==============================================================================
--- stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 11:44:58 2010 (r213923)
+++ stable/8/sys/cddl/contrib/opensolaris/uts/common/fs/zfs/zfs_vnops.c Sat Oct 16 11:52:43 2010 (r213924)
@@ -491,6 +491,8 @@ again:
* but it pessimize performance of sendfile/UFS, that's
* why I handle this special case in ZFS code.
*/
+ KASSERT(off == 0,
+ ("unexpected offset in mappedread for sendfile"));
if ((m->oflags & VPO_BUSY) != 0) {
/*
* Reference the page before unlocking and
@@ -511,14 +513,15 @@ again:
}
if (error == 0) {
va = zfs_map_page(m, &sf);
- error = dmu_read(os, zp->z_id, start + off,
- bytes, (void *)(va + off),
+ error = dmu_read(os, zp->z_id, start, bytes, va,
DMU_READ_PREFETCH);
+ if (bytes != PAGE_SIZE)
+ bzero(va + bytes, PAGE_SIZE - bytes);
zfs_unmap_page(sf);
}
VM_OBJECT_LOCK(obj);
if (error == 0)
- vm_page_set_valid(m, off, bytes);
+ m->valid = VM_PAGE_BITS_ALL;
vm_page_wakeup(m);
if (error == 0) {
uio->uio_resid -= bytes;
More information about the svn-src-stable
mailing list