From owner-svn-src-stable-8@FreeBSD.ORG Sat Oct 16 19:56:47 2010 Return-Path: Delivered-To: svn-src-stable-8@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6FA141065694; Sat, 16 Oct 2010 19:56:47 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 5DE168FC32; Sat, 16 Oct 2010 19:56:47 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id o9GJule2088191; Sat, 16 Oct 2010 19:56:47 GMT (envelope-from avg@svn.freebsd.org) Received: (from avg@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id o9GJulGP088189; Sat, 16 Oct 2010 19:56:47 GMT (envelope-from avg@svn.freebsd.org) Message-Id: <201010161956.o9GJulGP088189@svn.freebsd.org> From: Andriy Gapon Date: Sat, 16 Oct 2010 19:56:47 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org X-SVN-Group: stable-8 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r213933 - stable/8/sys/fs/tmpfs X-BeenThere: svn-src-stable-8@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for only the 8-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 16 Oct 2010 19:56:47 -0000 Author: avg Date: Sat Oct 16 19:56:46 2010 New Revision: 213933 URL: http://svn.freebsd.org/changeset/base/213933 Log: MFC r213735: tmpfs + sendfile: do not produce partially valid pages for vnode's tail Modified: stable/8/sys/fs/tmpfs/tmpfs_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/fs/tmpfs/tmpfs_vnops.c ============================================================================== --- stable/8/sys/fs/tmpfs/tmpfs_vnops.c Sat Oct 16 19:53:22 2010 (r213932) +++ stable/8/sys/fs/tmpfs/tmpfs_vnops.c Sat Oct 16 19:56:46 2010 (r213933) @@ -525,6 +525,8 @@ lookupvpg: VM_OBJECT_UNLOCK(vobj); return (error); } else if (m != NULL && uio->uio_segflg == UIO_NOCOPY) { + KASSERT(offset == 0, + ("unexpected offset in tmpfs_mappedread for sendfile")); if (vm_page_sleep_if_busy(m, FALSE, "tmfsmr")) goto lookupvpg; vm_page_busy(m); @@ -532,9 +534,10 @@ lookupvpg: sched_pin(); sf = sf_buf_alloc(m, SFB_CPUPRIVATE); ma = (char *)sf_buf_kva(sf); - error = tmpfs_nocacheread_buf(tobj, idx, offset, tlen, - ma + offset); + error = tmpfs_nocacheread_buf(tobj, idx, 0, tlen, ma); if (error == 0) { + if (tlen != PAGE_SIZE) + bzero(ma + tlen, PAGE_SIZE - tlen); uio->uio_offset += tlen; uio->uio_resid -= tlen; } @@ -542,7 +545,7 @@ lookupvpg: sched_unpin(); VM_OBJECT_LOCK(vobj); if (error == 0) - vm_page_set_valid(m, offset, tlen); + m->valid = VM_PAGE_BITS_ALL; vm_page_wakeup(m); VM_OBJECT_UNLOCK(vobj); return (error);