diff options
author | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-07-21 19:11:12 +0000 |
---|---|---|
committer | Michael Shalayeff <mickey@cvs.openbsd.org> | 2006-07-21 19:11:12 +0000 |
commit | 5ef6fc75c575edf19b6beaacd3c6a170ab12c8e7 (patch) | |
tree | f47d4041f1acceaf0cf16e8fcfd69f993a4fb23e /sys/dev | |
parent | 2205d8ad59d545de1486248c9b21c365e1359751 (diff) |
properly report errors thru scsi layer and not bio that will be overwritten later by scsi no no error; tested by mesel and nate@
Diffstat (limited to 'sys/dev')
-rw-r--r-- | sys/dev/ic/aac.c | 25 | ||||
-rw-r--r-- | sys/dev/ic/aac_tables.h | 4 |
2 files changed, 7 insertions, 22 deletions
diff --git a/sys/dev/ic/aac.c b/sys/dev/ic/aac.c index 3d7ee81aa72..b934a4e0dd9 100644 --- a/sys/dev/ic/aac.c +++ b/sys/dev/ic/aac.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aac.c,v 1.31 2006/04/28 02:51:27 brad Exp $ */ +/* $OpenBSD: aac.c,v 1.32 2006/07/21 19:11:11 mickey Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -1078,20 +1078,14 @@ aac_bio_complete(struct aac_command *cm) struct aac_blockread_response *brr; struct aac_blockwrite_response *bwr; struct scsi_xfer *xs = (struct scsi_xfer *)cm->cm_private; - struct buf *bp = xs->bp; AAC_FSAStatus status; int s; AAC_DPRINTF(AAC_D_CMD, ("%s: bio complete\n", cm->cm_sc->aac_dev.dv_xname)); - s = splbio(); - aac_release_command(cm); - if (bp == NULL) - goto exit; - /* fetch relevant status and then release the command */ - if (bp->b_flags & B_READ) { + if (xs->flags & SCSI_DATA_IN) { brr = (struct aac_blockread_response *)&cm->cm_fib->data[0]; status = brr->Status; } else { @@ -1099,19 +1093,10 @@ aac_bio_complete(struct aac_command *cm) status = bwr->Status; } - /* fix up the bio based on status */ - if (status == ST_OK) { - bp->b_resid = 0; - } else { - bp->b_error = EIO; - bp->b_flags |= B_ERROR; - - /* pass an error string out to the disk layer */ - aac_describe_code(aac_command_status_table, status); - } + s = splbio(); + aac_release_command(cm); - exit: - xs->error = XS_NOERROR; + xs->error = status == ST_OK? XS_NOERROR : XS_DRIVER_STUFFUP; xs->resid = 0; xs->flags |= ITSDONE; scsi_done(xs); diff --git a/sys/dev/ic/aac_tables.h b/sys/dev/ic/aac_tables.h index 3ba773425fd..b61d1076e6b 100644 --- a/sys/dev/ic/aac_tables.h +++ b/sys/dev/ic/aac_tables.h @@ -1,4 +1,4 @@ -/* $OpenBSD: aac_tables.h,v 1.3 2005/11/18 05:39:10 nate Exp $ */ +/* $OpenBSD: aac_tables.h,v 1.4 2006/07/21 19:11:11 mickey Exp $ */ /*- * Copyright (c) 2000 Michael Smith @@ -36,7 +36,7 @@ * XXX many of these would not normally be returned, as they are * relevant only to FSA operations. */ -static struct aac_code_lookup aac_command_status_table[] = { +const struct aac_code_lookup aac_command_status_table[] = { { "OK", 0 }, { "operation not permitted", 1 }, { "not found", 2 }, |