Skip to content

Commit

Permalink
target: Return correct sense data for IO past the end of a device
Browse files Browse the repository at this point in the history
We should use TCM_ADDRESS_OUT_OF_RANGE (-> sense data LOGICAL BLOCK
ADDRESS OUT OF RANGE) for IOs past the end of a device instead of
INVALID FIELD IN CDB.

Signed-off-by: Roland Dreier <roland@purestorage.com>
Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
  • Loading branch information
Roland Dreier authored and Nicholas Bellinger committed Jul 8, 2013
1 parent e5c0d6a commit 09ceadc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/target/target_core_sbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,7 @@ sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
pr_err("cmd exceeds last lba %llu "
"(lba %llu, sectors %u)\n",
end_lba, cmd->t_task_lba, sectors);
return TCM_INVALID_CDB_FIELD;
return TCM_ADDRESS_OUT_OF_RANGE;
}

size = sbc_get_size(cmd, sectors);
Expand Down

0 comments on commit 09ceadc

Please sign in to comment.