diff options
author | kib <kib@FreeBSD.org> | 2013-07-11 05:36:26 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2013-07-11 05:36:26 +0000 |
commit | 6d305886664ac1ea75a4f856838b7e5e0b1c44e0 (patch) | |
tree | cc771cae4d9c604fc604d95e8d05f7987b777b6f /sys/kern/vfs_bio.c | |
parent | ba3ad070c05736608121d04b00a812a675c78bb7 (diff) | |
download | FreeBSD-src-6d305886664ac1ea75a4f856838b7e5e0b1c44e0.zip FreeBSD-src-6d305886664ac1ea75a4f856838b7e5e0b1c44e0.tar.gz |
Do not invalidate page of the B_NOCACHE buffer or buffer after an I/O
error if any user wired mappings exist. Doing the invalidation
destroys the user wiring.
The change is the temporal measure to close the bug, the more proper
fix is to delegate the invalidation of the page to upper layers
always.
Reported and tested by: pho
Reviewed by: alc
Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks
Diffstat (limited to 'sys/kern/vfs_bio.c')
-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 c5af3f5..68021e0 100644 --- a/sys/kern/vfs_bio.c +++ b/sys/kern/vfs_bio.c @@ -1692,7 +1692,8 @@ brelse(struct buf *bp) KASSERT(presid >= 0, ("brelse: extra page")); VM_OBJECT_WLOCK(obj); - vm_page_set_invalid(m, poffset, presid); + if (pmap_page_wired_mappings(m) == 0) + vm_page_set_invalid(m, poffset, presid); VM_OBJECT_WUNLOCK(obj); if (had_bogus) printf("avoided corruption bug in bogus_page/brelse code\n"); |