Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 9 Aug 2009 11:47:40 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r196087 - in stable/7/sys: . contrib/pf kern
Message-ID:  <200908091147.n79BleJ7067102@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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;



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200908091147.n79BleJ7067102>