Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 302415
b: refs/heads/master
c: 7b4deef
h: refs/heads/master
i:
  302413: 88bb608
  302411: 8c1e3e2
  302407: 960ec44
  302399: 90ee5a0
v: v3
  • Loading branch information
Nicholas Bellinger committed May 9, 2012
1 parent 2361cab commit f812b56
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d5dc28eb92f2a2305a02cb3a5f1ed36542d47512
refs/heads/master: 7b4deef5d9a1fa74ccfbd07b4cfe795ee18fceca
21 changes: 15 additions & 6 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit f812b56

Please sign in to comment.