|
@@ -2973,12 +2973,21 @@ static int transport_generic_cmd_sequencer(
|
|
|
cmd->data_length = size;
|
|
|
}
|
|
|
|
|
|
- if (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB &&
|
|
|
- (sectors > dev->se_sub_dev->se_dev_attrib.fabric_max_sectors ||
|
|
|
- sectors > dev->se_sub_dev->se_dev_attrib.max_sectors)) {
|
|
|
- printk_ratelimited(KERN_ERR "SCSI OP %02xh with too big sectors %u\n",
|
|
|
- cdb[0], sectors);
|
|
|
- goto out_invalid_cdb_field;
|
|
|
+ if (cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) {
|
|
|
+ if (sectors > su_dev->se_dev_attrib.fabric_max_sectors) {
|
|
|
+ printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
|
|
|
+ " big sectors %u exceeds fabric_max_sectors:"
|
|
|
+ " %u\n", cdb[0], sectors,
|
|
|
+ su_dev->se_dev_attrib.fabric_max_sectors);
|
|
|
+ goto out_invalid_cdb_field;
|
|
|
+ }
|
|
|
+ if (sectors > su_dev->se_dev_attrib.hw_max_sectors) {
|
|
|
+ printk_ratelimited(KERN_ERR "SCSI OP %02xh with too"
|
|
|
+ " big sectors %u exceeds backend hw_max_sectors:"
|
|
|
+ " %u\n", cdb[0], sectors,
|
|
|
+ su_dev->se_dev_attrib.hw_max_sectors);
|
|
|
+ goto out_invalid_cdb_field;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
/* reject any command that we don't have a handler for */
|