diff options
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/md/md.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/sys/dev/md/md.c b/sys/dev/md/md.c index e871d8f..57c5b57 100644 --- a/sys/dev/md/md.c +++ b/sys/dev/md/md.c @@ -829,7 +829,9 @@ mdstart_swap(struct md_s *sc, struct bio *bp) m = vm_page_grab(sc->object, i, VM_ALLOC_NORMAL | VM_ALLOC_RETRY); if (bp->bio_cmd == BIO_READ) { - if (m->valid != VM_PAGE_BITS_ALL) + if (m->valid == VM_PAGE_BITS_ALL) + rv = VM_PAGER_OK; + else rv = vm_pager_get_pages(sc->object, &m, 1, 0); if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); @@ -854,6 +856,8 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } else if (bp->bio_cmd == BIO_WRITE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); break; @@ -868,6 +872,8 @@ mdstart_swap(struct md_s *sc, struct bio *bp) } else if (bp->bio_cmd == BIO_DELETE) { if (len != PAGE_SIZE && m->valid != VM_PAGE_BITS_ALL) rv = vm_pager_get_pages(sc->object, &m, 1, 0); + else + rv = VM_PAGER_OK; if (rv == VM_PAGER_ERROR) { vm_page_wakeup(m); break; |