diff options
author | Matt Jacob <mjacob@FreeBSD.org> | 2006-04-11 21:36:43 +0000 |
---|---|---|
committer | Matt Jacob <mjacob@FreeBSD.org> | 2006-04-11 21:36:43 +0000 |
commit | 6070eb3f9315ef30958af8d69285e69ccf22f2e5 (patch) | |
tree | 572351a9c1eb3d1b9be64bef15ab3dc567c67eb2 /share/examples/scsi_target | |
parent | e1011813936f04404bee1ae68c4f7d85ba5b3933 (diff) |
If we end up with a CTIO completing with CAM_REQUEUE_REQ,
be obliging and just redo the request instead of squawking
and dying.
Notes
Notes:
svn path=/head/; revision=157670
Diffstat (limited to 'share/examples/scsi_target')
-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 dd0b0694f1ad..bd23bedb6af6 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; |