Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358911
b: refs/heads/master
c: bb992e7
h: refs/heads/master
i:
  358909: a76cebf
  358907: d00f8c6
  358903: 1748001
  358895: 9ccb004
  358879: ab96524
  358847: de3ad5d
  358783: 1f60830
  358655: 4829203
  358399: 13c6cfd
v: v3
  • Loading branch information
Roland Dreier authored and Nicholas Bellinger committed Feb 13, 2013
1 parent 5b957f7 commit 2072241
Show file tree
Hide file tree
Showing 4 changed files with 22 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 33633676df0d16d0685f2fbc571143801bc16e3b
refs/heads/master: bb992e72f9b751fceb04afeb7736b6a3e50effcf
11 changes: 10 additions & 1 deletion trunk/drivers/target/target_core_iblock.c
Original file line number Diff line number Diff line change
Expand Up @@ -391,10 +391,19 @@ iblock_execute_unmap(struct se_cmd *cmd)
sense_reason_t ret = 0;
int dl, bd_dl, err;

/* We never set ANC_SUP */
if (cmd->t_task_cdb[1])
return TCM_INVALID_CDB_FIELD;

if (cmd->data_length == 0) {
target_complete_cmd(cmd, SAM_STAT_GOOD);
return 0;
}

if (cmd->data_length < 8) {
pr_warn("UNMAP parameter list length %u too small\n",
cmd->data_length);
return TCM_INVALID_PARAMETER_LIST;
return TCM_PARAMETER_LIST_LENGTH_ERROR;
}

buf = transport_kmap_data_sg(cmd);
Expand Down
10 changes: 10 additions & 0 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,7 @@ void transport_generic_request_failure(struct se_cmd *cmd,
case TCM_UNSUPPORTED_SCSI_OPCODE:
case TCM_INVALID_CDB_FIELD:
case TCM_INVALID_PARAMETER_LIST:
case TCM_PARAMETER_LIST_LENGTH_ERROR:
case TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE:
case TCM_UNKNOWN_MODE_PAGE:
case TCM_WRITE_PROTECTED:
Expand Down Expand Up @@ -2677,6 +2678,15 @@ transport_send_check_condition_and_sense(struct se_cmd *cmd,
/* INVALID FIELD IN PARAMETER LIST */
buffer[SPC_ASC_KEY_OFFSET] = 0x26;
break;
case TCM_PARAMETER_LIST_LENGTH_ERROR:
/* CURRENT ERROR */
buffer[0] = 0x70;
buffer[SPC_ADD_SENSE_LEN_OFFSET] = 10;
/* ILLEGAL REQUEST */
buffer[SPC_SENSE_KEY_OFFSET] = ILLEGAL_REQUEST;
/* PARAMETER LIST LENGTH ERROR */
buffer[SPC_ASC_KEY_OFFSET] = 0x1a;
break;
case TCM_UNEXPECTED_UNSOLICITED_DATA:
/* CURRENT ERROR */
buffer[0] = 0x70;
Expand Down
1 change: 1 addition & 0 deletions trunk/include/target/target_core_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ enum tcm_sense_reason_table {
TCM_RESERVATION_CONFLICT = R(0x10),
TCM_ADDRESS_OUT_OF_RANGE = R(0x11),
TCM_OUT_OF_RESOURCES = R(0x12),
TCM_PARAMETER_LIST_LENGTH_ERROR = R(0x13),
#undef R
};

Expand Down

0 comments on commit 2072241

Please sign in to comment.