Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
{OUT_OF_TREE_DEBUG} Heavy trace of the sg_continuation paths
No longer needed after fixing all the initiator bugs

Boaz
  • Loading branch information
Boaz Harrosh committed Dec 12, 2010
1 parent 40ec6f8 commit 3ee776d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 6 deletions.
15 changes: 15 additions & 0 deletions osd-target/cdb.c
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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;
}

Expand Down
14 changes: 8 additions & 6 deletions osd-target/osd.c
Expand Up @@ -3731,15 +3731,15 @@ 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);

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;
Expand All @@ -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;
}
Expand Down Expand Up @@ -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);
}
Expand Down

0 comments on commit 3ee776d

Please sign in to comment.