From 3ee776d8d3065e3d277bb67de379b5b961c0adbe Mon Sep 17 00:00:00 2001 From: Boaz Harrosh Date: Wed, 29 Sep 2010 14:36:17 +0200 Subject: [PATCH] {OUT_OF_TREE_DEBUG} Heavy trace of the sg_continuation paths No longer needed after fixing all the initiator bugs Boaz --- osd-target/cdb.c | 15 +++++++++++++++ osd-target/osd.c | 14 ++++++++------ 2 files changed, 23 insertions(+), 6 deletions(-) diff --git a/osd-target/cdb.c b/osd-target/cdb.c index 37b2de0..3eaec33 100644 --- a/osd-target/cdb.c +++ b/osd-target/cdb.c @@ -1360,15 +1360,19 @@ static int parse_cdb_continuation_segment(struct command *cmd, * in the maximum CDB continuation length attribute in the root * information attributes page (7.1.3.8) */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } if (cont_action != cmd->action) { +osd_warning("%s:%d: cont_action=0x%x cmd->action=0x%x cdb_cont_len=%d cont_format=%d", + __FILE__, __LINE__, cont_action, cmd->action, cdb_cont_len, cont_format); goto out_cdb_err; } /* continuation format 1 is the only format defined in OSDr204 */ if (cont_format != 1) { +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } @@ -1403,15 +1407,20 @@ static int parse_cdb_continuation_segment(struct command *cmd, * than the value of the supported CDB continuation * descriptor type information attributes page (7.1.3.8) */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } desc_len += sizeof(*desc_hdr); + +// osd_warning("%s:%d: desc_len=%d cdb_cont_len=%d uptilnow=%zu", __FILE__, __LINE__, desc_len, cdb_cont_len, cdb_cont-cmd->indata); + if ((cdb_cont + desc_len) > (cmd->indata + cdb_cont_len)) { /* XXX The spec doesnt say what to do if the length of this descriptor goes past the end of the continuation. For now, we'll just return an error. */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } @@ -1425,6 +1434,7 @@ static int parse_cdb_continuation_segment(struct command *cmd, case SCATTER_GATHER_LIST: { if (pad_length != 0) { /* osd2r04 5.4.2 - pad length must be 0 */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } @@ -1439,6 +1449,7 @@ static int parse_cdb_continuation_segment(struct command *cmd, case QUERY_LIST: { if (pad_length != 0) { /* osd2r04 5.4.3 - pad length must be 0 */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } @@ -1448,20 +1459,24 @@ static int parse_cdb_continuation_segment(struct command *cmd, case USER_OBJECT: { /* not supported yet */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } case COPY_USER_OBJECT_SOURCE: { desc->desc_specific_hdr = (const uint8_t *)(desc_hdr+1); +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } case EXTENSION_CAPABILITIES: { /* not supported yet */ +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } default: +osd_warning("%s:%d:", __FILE__, __LINE__); goto out_cdb_err; } diff --git a/osd-target/osd.c b/osd-target/osd.c index 0c2b9e9..15a8a91 100644 --- a/osd-target/osd.c +++ b/osd-target/osd.c @@ -3731,7 +3731,7 @@ static int sgl_write(struct osd_device *osd, uint64_t pid, uint64_t oid, uint64_t pairs, data_offset, offset_val, length; unsigned int i; - osd_debug("%s: pid %llu oid %llu len %llu offset %llu data %p", + osd_info("%s: pid %llu oid %llu len %llu offset %llu data %p", __func__, llu(pid), llu(oid), llu(len), llu(offset), dinbuf); assert(osd && osd->root && osd->dbc && dinbuf && sense); @@ -3739,7 +3739,7 @@ static int sgl_write(struct osd_device *osd, uint64_t pid, uint64_t oid, pairs = sglist->num_entries; assert(pairs != 0); - osd_debug("%s: offset,len pairs %llu", __func__, llu(pairs)); + osd_info("%s: offset,len pairs %llu", __func__, llu(pairs)); if (!(pid >= USEROBJECT_PID_LB && oid >= USEROBJECT_OID_LB)) goto out_cdb_err; @@ -3756,16 +3756,16 @@ static int sgl_write(struct osd_device *osd, uint64_t pid, uint64_t oid, offset_val = get_ntohll(&sglist->entries[i].offset); length = get_ntohll(&sglist->entries[i].bytes_to_transfer); - osd_debug("%s: Offset: %llu Length: %llu", + osd_info("%s: Offset: %llu Length: %llu", __func__, llu(offset_val + offset), llu(length)); - osd_debug("%s: Position in data buffer: %llu", + osd_info("%s: Position in data buffer: %llu", __func__, llu(data_offset)); - osd_debug("%s: ------------------------------", __func__); + osd_info("%s: ------------------------------", __func__); ret = pwrite(fd, dinbuf+data_offset, length, offset_val+offset); data_offset += length; - osd_debug("%s: return value is %d", __func__, ret); + osd_info("%s: return value is %d", __func__, ret); if (ret < 0 || (uint64_t)ret != length) goto out_hw_err; } @@ -3884,6 +3884,8 @@ int osd_write(struct osd_device *osd, uint64_t pid, uint64_t oid, sense); } default: { + osd_info("osd_write!!! ddt=%d\n", ddt); + return sense_build_sdd(sense, OSD_SSK_ILLEGAL_REQUEST, OSD_ASC_INVALID_FIELD_IN_CDB, pid, oid); }