diff options
author | kib <kib@FreeBSD.org> | 2009-07-19 20:25:59 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-07-19 20:25:59 +0000 |
commit | 9defbad772d8a70e282b11397513b9380177143a (patch) | |
tree | 3d0ec1113dd334e28b28ab00e1a608de6b9d94b8 /sys/kern | |
parent | ec40877eda62735f117b38684a1eb92b75b172e5 (diff) | |
download | FreeBSD-src-9defbad772d8a70e282b11397513b9380177143a.zip FreeBSD-src-9defbad772d8a70e282b11397513b9380177143a.tar.gz |
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
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/vfs_bio.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/sys/kern/vfs_bio.c b/sys/kern/vfs_bio.c index 65e9460..df9a257 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -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; |