From d88d3897b5c856eb2af60f16af44296747019288 Mon Sep 17 00:00:00 2001 From: Vladislav Bolkhovitin Date: Mon, 2 Apr 2007 10:55:55 +0000 Subject: [PATCH] Minor fixes git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@103 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- qla2x00t/qla2x00-target/qla2x00t.c | 22 +++++++++++++++++++--- scst/src/dev_handlers/scst_vdisk.c | 2 ++ 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/qla2x00t/qla2x00-target/qla2x00t.c b/qla2x00t/qla2x00-target/qla2x00t.c index b00c61d1a..a950fc210 100644 --- a/qla2x00t/qla2x00-target/qla2x00t.c +++ b/qla2x00t/qla2x00-target/qla2x00t.c @@ -975,6 +975,7 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha, struct scst_cmd *scst_cmd; struct q2t_cmd *cmd; uint16_t loop_id = -1; + int err = 0; TRACE_ENTRY(); @@ -994,23 +995,24 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha, case CTIO_ABORTED: case CTIO_TIMEOUT: case CTIO_INVALID_RX_ID: + err = 1; /* they are OK */ -#if defined(DEBUG) || defined(TRACING) - PRINT_INFO("qla2x00tgt(%ld): CTIO with status %#x " + TRACE_MGMT_DBG("qla2x00tgt(%ld): CTIO with status %#x " "received (LIP_RESET=e, ABORTED=2, " "TARGET_RESET=17, TIMEOUT=b, " "INVALID_RX_ID=8)", ha->instance, status); -#endif break; case CTIO_PORT_LOGGED_OUT: case CTIO_PORT_UNAVAILABLE: + err = 1; PRINT_INFO("qla2x00tgt(%ld): CTIO with PORT LOGGED " "OUT (29) or PORT UNAVAILABLE (28) status %x " "received", ha->instance, status); break; default: + err = 1; PRINT_ERROR("qla2x00tgt(%ld): CTIO with error status " "0x%x received", ha->instance, status); break; @@ -1032,6 +1034,10 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha, ha->instance, handle); goto out; } + if (unlikely(err)) { + PRINT_INFO("Found by handle failed CTIO scst_cmd " + "%p (op %x)", scst_cmd, scst_cmd->cdb[0]); + } } else if (ctio != NULL) { uint32_t tag = le16_to_cpu(ctio->exchange_id); struct q2t_sess *sess = q2t_find_sess_by_lid(ha->tgt, loop_id); @@ -1051,12 +1057,19 @@ static void q2t_do_ctio_completion(scsi_qla_host_t *ha, ha->instance, tag, loop_id); goto out; } + if (unlikely(err)) { + PRINT_INFO("Found by ctio failed CTIO scst_cmd %p " + "(op %x)", scst_cmd, scst_cmd->cdb[0]); + } TRACE_DBG("Found scst_cmd %p", scst_cmd); } else goto out; cmd = (struct q2t_cmd *)scst_cmd_get_tgt_priv(scst_cmd); + if (unlikely(err)) { + PRINT_INFO("Failed CTIO state %d", cmd->state); + } if (cmd->state == Q2T_STATE_PROCESSED) { TRACE_DBG("Command %p finished", cmd); @@ -1103,6 +1116,9 @@ out: return; out_free: + if (unlikely(err)) { + TRACE_MGMT_DBG("%s", "Finishing failed CTIO"); + } scst_tgt_cmd_done(scst_cmd); goto out; } diff --git a/scst/src/dev_handlers/scst_vdisk.c b/scst/src/dev_handlers/scst_vdisk.c index c0c424f3a..ca18e36ea 100644 --- a/scst/src/dev_handlers/scst_vdisk.c +++ b/scst/src/dev_handlers/scst_vdisk.c @@ -782,6 +782,8 @@ static int vdisk_do_job(struct scst_cmd *cmd) vdisk_exec_read_toc(cmd); break; case START_STOP: + vdisk_fsync(thr, 0, virt_dev->file_size, cmd); + break; case RESERVE: case RESERVE_10: case RELEASE: