From owner-svn-src-all@FreeBSD.ORG Sun Jul 19 20:25:59 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 D9057106564A; Sun, 19 Jul 2009 20:25:59 +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 C322A8FC08; Sun, 19 Jul 2009 20:25:59 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n6JKPx0o053075; Sun, 19 Jul 2009 20:25:59 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n6JKPxFg053073; Sun, 19 Jul 2009 20:25:59 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200907192025.n6JKPxFg053073@svn.freebsd.org> From: Konstantin Belousov Date: Sun, 19 Jul 2009 20:25:59 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r195773 - head/sys/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, 19 Jul 2009 20:26:00 -0000 Author: kib Date: Sun Jul 19 20:25:59 2009 New Revision: 195773 URL: http://svn.freebsd.org/changeset/base/195773 Log: 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. Reported and tested by: pho Approved by: re (kensmith) MFC after: 3 weeks Modified: head/sys/kern/vfs_bio.c Modified: head/sys/kern/vfs_bio.c ============================================================================== --- head/sys/kern/vfs_bio.c Sun Jul 19 19:01:30 2009 (r195772) +++ head/sys/kern/vfs_bio.c Sun Jul 19 20:25:59 2009 (r195773) @@ -1330,7 +1330,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;