aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/target/target_core_transport.c21
1 files changed, 15 insertions, 6 deletions
diff --git a/drivers/target/target_core_transport.c b/drivers/target/target_core_transport.c
index 5c06b87a3114..a10d7847f037 100644
--- a/drivers/target/target_core_transport.c
+++ b/drivers/target/target_core_transport.c
@@ -2973,12 +2973,21 @@ static int transport_generic_cmd_sequencer(
2973 cmd->data_length = size; 2973 cmd->data_length = size;
2974 } 2974 }
2975 2975
2976 if (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB && 2976 if (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) {
2977 (sectors > dev->se_sub_dev->se_dev_attrib.fabric_max_sectors || 2977 if (sectors > su_dev->se_dev_attrib.fabric_max_sectors) {
2978 sectors > dev->se_sub_dev->se_dev_attrib.max_sectors)) { 2978 printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
2979 printk_ratelimited(KERN_ERR "SCSI OP %02xh with too big sectors %u\n", 2979 " big sectors %u exceeds fabric_max_sectors:"
2980 cdb[0], sectors); 2980 " %u\n", cdb[0], sectors,
2981 goto out_invalid_cdb_field; 2981 su_dev->se_dev_attrib.fabric_max_sectors);
2982 goto out_invalid_cdb_field;
2983 }
2984 if (sectors > su_dev->se_dev_attrib.hw_max_sectors) {
2985 printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
2986 " big sectors %u exceeds backend hw_max_sectors:"
2987 " %u\n", cdb[0], sectors,
2988 su_dev->se_dev_attrib.hw_max_sectors);
2989 goto out_invalid_cdb_field;
2990 }
2982 } 2991 }
2983 2992
2984 /* reject any command that we don't have a handler for */ 2993 /* reject any command that we don't have a handler for */