diff options
author | Tang Wenji <tang.wenji@zte.com.cn> | 2017-07-07 23:28:25 -0400 |
---|---|---|
committer | Nicholas Bellinger <nab@linux-iscsi.org> | 2017-07-09 23:59:17 -0400 |
commit | 7ee0031786dc3762f61d0ec9171bb75d56a5ac76 (patch) | |
tree | 858f476904d4781ed8bb49d90e6f55ce0def11e9 | |
parent | 388fe6996bf658146e70c0df986981eae4be0385 (diff) |
target: Fix return sense reason in target_scsi3_emulate_pr_out
The sense reason should be TCM_PARAMETER_LIST_LENGTH_ERROR when
parmeter length error.
Also the cdb[1] & 0x1f has been assigned to local variable sa,
so use sa instead of it.
Signed-off-by: Tang Wenji <tang.wenji@zte.com.cn>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r-- | drivers/target/target_core_pr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/target/target_core_pr.c b/drivers/target/target_core_pr.c index 9921d4d6bb41..6d5def64db61 100644 --- a/drivers/target/target_core_pr.c +++ b/drivers/target/target_core_pr.c | |||
@@ -3585,7 +3585,7 @@ target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3585 | if (cmd->data_length < 24) { | 3585 | if (cmd->data_length < 24) { |
3586 | pr_warn("SPC-PR: Received PR OUT parameter list" | 3586 | pr_warn("SPC-PR: Received PR OUT parameter list" |
3587 | " length too small: %u\n", cmd->data_length); | 3587 | " length too small: %u\n", cmd->data_length); |
3588 | return TCM_INVALID_PARAMETER_LIST; | 3588 | return TCM_PARAMETER_LIST_LENGTH_ERROR; |
3589 | } | 3589 | } |
3590 | 3590 | ||
3591 | /* | 3591 | /* |
@@ -3629,7 +3629,7 @@ target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3629 | /* | 3629 | /* |
3630 | * SPEC_I_PT=1 is only valid for Service action: REGISTER | 3630 | * SPEC_I_PT=1 is only valid for Service action: REGISTER |
3631 | */ | 3631 | */ |
3632 | if (spec_i_pt && ((cdb[1] & 0x1f) != PRO_REGISTER)) | 3632 | if (spec_i_pt && (sa != PRO_REGISTER)) |
3633 | return TCM_INVALID_PARAMETER_LIST; | 3633 | return TCM_INVALID_PARAMETER_LIST; |
3634 | 3634 | ||
3635 | /* | 3635 | /* |
@@ -3641,11 +3641,11 @@ target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3641 | * the sense key set to ILLEGAL REQUEST, and the additional sense | 3641 | * the sense key set to ILLEGAL REQUEST, and the additional sense |
3642 | * code set to PARAMETER LIST LENGTH ERROR. | 3642 | * code set to PARAMETER LIST LENGTH ERROR. |
3643 | */ | 3643 | */ |
3644 | if (!spec_i_pt && ((cdb[1] & 0x1f) != PRO_REGISTER_AND_MOVE) && | 3644 | if (!spec_i_pt && (sa != PRO_REGISTER_AND_MOVE) && |
3645 | (cmd->data_length != 24)) { | 3645 | (cmd->data_length != 24)) { |
3646 | pr_warn("SPC-PR: Received PR OUT illegal parameter" | 3646 | pr_warn("SPC-PR: Received PR OUT illegal parameter" |
3647 | " list length: %u\n", cmd->data_length); | 3647 | " list length: %u\n", cmd->data_length); |
3648 | return TCM_INVALID_PARAMETER_LIST; | 3648 | return TCM_PARAMETER_LIST_LENGTH_ERROR; |
3649 | } | 3649 | } |
3650 | 3650 | ||
3651 | /* | 3651 | /* |
@@ -3685,7 +3685,7 @@ target_scsi3_emulate_pr_out(struct se_cmd *cmd) | |||
3685 | break; | 3685 | break; |
3686 | default: | 3686 | default: |
3687 | pr_err("Unknown PERSISTENT_RESERVE_OUT service" | 3687 | pr_err("Unknown PERSISTENT_RESERVE_OUT service" |
3688 | " action: 0x%02x\n", cdb[1] & 0x1f); | 3688 | " action: 0x%02x\n", sa); |
3689 | return TCM_INVALID_CDB_FIELD; | 3689 | return TCM_INVALID_CDB_FIELD; |
3690 | } | 3690 | } |
3691 | 3691 | ||