When a bio comes back from below with a zero error code, check that
it wrote the full length. The only case where this should be able to happen is if we try to read/write past the end and the request is truncated. We obviously should never try to do that, so this code should never activate.
This commit is contained in:
parent
1ea349191e
commit
ca8f372bbc
@ -403,6 +403,8 @@ g_bde_write_done(struct bio *bp)
|
||||
KASSERT(sc != NULL, ("NULL sc"));
|
||||
KASSERT(sp->owner != NULL, ("NULL sp->owner"));
|
||||
g_trace(G_T_TOPOLOGY, "g_bde_write_done(%p)", sp);
|
||||
if (bp->bio_error == 0 && bp->bio_completed != sp->size)
|
||||
bp->bio_error = EIO;
|
||||
sp->error = bp->bio_error;
|
||||
g_destroy_bio(bp);
|
||||
wp = sp->owner;
|
||||
@ -479,6 +481,8 @@ g_bde_read_done(struct bio *bp)
|
||||
g_trace(G_T_TOPOLOGY, "g_bde_read_done(%p)", sp);
|
||||
sc = bp->bio_caller2;
|
||||
mtx_lock(&sc->worklist_mutex);
|
||||
if (bp->bio_error == 0 && bp->bio_completed != sp->siz)
|
||||
bp->bio_error = EIO;
|
||||
sp->error = bp->bio_error;
|
||||
if (sp->error == 0)
|
||||
sp->state = VALID;
|
||||
|
Loading…
x
Reference in New Issue
Block a user