diff options
author | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-07-05 10:04:28 +0000 |
---|---|---|
committer | Matthew Dempsky <matthew@cvs.openbsd.org> | 2011-07-05 10:04:28 +0000 |
commit | ff8afdb2a8226b6e6d81a06f6b4bf09bbe6605e5 (patch) | |
tree | 0c372deed1813a67b5a835d97159a271003c0d7c | |
parent | 7f84241bbef9fa3398f457770fee47c3d19ced26 (diff) |
If uvm_vslock_device() fails, just exit the loop. None of the
after_unlock code is needed if this happens, and running it was even
wrong because we weren't setting b_resid, so uio_offset (and higher
up, f_offset) would be incorrectly adjusted.
Discussed with deraadt@.
-rw-r--r-- | sys/kern/kern_physio.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/sys/kern/kern_physio.c b/sys/kern/kern_physio.c index 11975ed4044..dbec4415d02 100644 --- a/sys/kern/kern_physio.c +++ b/sys/kern/kern_physio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_physio.c,v 1.34 2011/07/05 09:46:11 matthew Exp $ */ +/* $OpenBSD: kern_physio.c,v 1.35 2011/07/05 10:04:27 matthew Exp $ */ /* $NetBSD: kern_physio.c,v 1.28 1997/05/19 10:43:28 pk Exp $ */ /*- @@ -144,11 +144,8 @@ physio(void (*strategy)(struct buf *), dev_t dev, int flags, error = uvm_vslock_device(p, iovp->iov_base, todo, (flags & B_READ) ? VM_PROT_READ | VM_PROT_WRITE : VM_PROT_READ, &map); - if (error) { - bp->b_flags |= B_ERROR; - bp->b_error = error; - goto after_unlock; - } + if (error) + goto done; if (map) { bp->b_data = map; } else { @@ -186,7 +183,6 @@ physio(void (*strategy)(struct buf *), dev_t dev, int flags, if (!map) vunmapbuf(bp, todo); uvm_vsunlock_device(p, iovp->iov_base, todo, map); -after_unlock: /* remember error value (save a splbio/splx pair) */ if (bp->b_flags & B_ERROR) |