Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 19 Jul 2009 20:25:59 +0000 (UTC)
From:      Konstantin Belousov <kib@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r195773 - head/sys/kern
Message-ID:  <200907192025.n6JKPxFg053073@svn.freebsd.org>

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



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