From: Roland Dreier Date: Thu, 27 Jun 2013 00:36:18 +0000 (-0700) Subject: target: Return correct sense data for IO past the end of a device X-Git-Tag: upstream/snapshot3+hdmi~4711^2~10 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=09ceadc70383a4105c0372f9e83da2c0cb0a8017;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git target: Return correct sense data for IO past the end of a device 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 Signed-off-by: Nicholas Bellinger --- diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index bbc5b0e..ee0cb9d 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -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);