diff options
author | mjacob <mjacob@FreeBSD.org> | 2006-04-11 21:36:43 +0000 |
---|---|---|
committer | mjacob <mjacob@FreeBSD.org> | 2006-04-11 21:36:43 +0000 |
commit | 8ecd1bb434632b0dfe8e87337950dea74c4539d0 (patch) | |
tree | 572351a9c1eb3d1b9be64bef15ab3dc567c67eb2 | |
parent | 913293e6360d5e73afcde065a3748b735fe248dd (diff) | |
download | FreeBSD-src-8ecd1bb434632b0dfe8e87337950dea74c4539d0.zip FreeBSD-src-8ecd1bb434632b0dfe8e87337950dea74c4539d0.tar.gz |
If we end up with a CTIO completing with CAM_REQUEUE_REQ,
be obliging and just redo the request instead of squawking
and dying.
-rw-r--r-- | share/examples/scsi_target/scsi_cmds.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/share/examples/scsi_target/scsi_cmds.c b/share/examples/scsi_target/scsi_cmds.c index dd0b069..bd23bed 100644 --- a/share/examples/scsi_target/scsi_cmds.c +++ b/share/examples/scsi_target/scsi_cmds.c @@ -689,8 +689,22 @@ tcmd_rdwr_done(struct ccb_accept_tio *atio, struct ccb_scsiio *ctio, } break; case CTIO_DONE: - if (ctio->ccb_h.status != CAM_REQ_CMP) { - /* XXX */ + switch (ctio->ccb_h.status & CAM_STATUS_MASK) { + case CAM_REQ_CMP: + break; + case CAM_REQUEUE_REQ: + warnx("requeueing request"); + if ((a_descr->flags & CAM_DIR_MASK) == CAM_DIR_OUT) { + if (aio_write(&c_descr->aiocb) < 0) { + err(1, "aio_write"); /* XXX */ + } + } else { + if (aio_read(&c_descr->aiocb) < 0) { + err(1, "aio_read"); /* XXX */ + } + } + return; + default: errx(1, "CTIO failed, status %#x", ctio->ccb_h.status); } a_descr->init_ack += ctio->dxfer_len; |