From owner-svn-src-all@FreeBSD.ORG Sun Aug 9 11:47:40 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 51D061065674; Sun, 9 Aug 2009 11:47:40 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 413EB8FC2A; Sun, 9 Aug 2009 11:47:40 +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 n79Blehm067103; Sun, 9 Aug 2009 11:47:40 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n79BleJ7067102; Sun, 9 Aug 2009 11:47:40 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200908091147.n79BleJ7067102@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 9 Aug 2009 11:47:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org X-SVN-Group: stable-7 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r196087 - in stable/7/sys: . contrib/pf kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 09 Aug 2009 11:47:41 -0000 Author: kib Date: Sun Aug 9 11:47:39 2009 New Revision: 196087 URL: http://svn.freebsd.org/changeset/base/196087 Log: MFC r195773: When buffer write is failed, it is wrong for brelse() to invalidate portion of the page that was written. Among other problems, this page might be picked up by pagedaemon, with failed assertion in vm_pageout_flush() about validity of the page. Modified: stable/7/sys/ (props changed) stable/7/sys/contrib/pf/ (props changed) stable/7/sys/kern/vfs_bio.c Modified: stable/7/sys/kern/vfs_bio.c ============================================================================== --- stable/7/sys/kern/vfs_bio.c Fri Aug 7 15:41:16 2009 (r196086) +++ stable/7/sys/kern/vfs_bio.c Sun Aug 9 11:47:39 2009 (r196087) @@ -1347,7 +1347,8 @@ brelse(struct buf *bp) m = bp->b_pages[i]; } if ((bp->b_flags & B_NOCACHE) || - (bp->b_ioflags & BIO_ERROR)) { + (bp->b_ioflags & BIO_ERROR && + bp->b_iocmd == BIO_READ)) { int poffset = foff & PAGE_MASK; int presid = resid > (PAGE_SIZE - poffset) ? (PAGE_SIZE - poffset) : resid;