Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 276470
b: refs/heads/master
c: fef58a6
h: refs/heads/master
v: v3
  • Loading branch information
Nicholas Bellinger committed Dec 6, 2011
1 parent 9ed2400 commit 2939848
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6fd126ffebef3897d8fca98644a9fd1cc5c7a5e3
refs/heads/master: fef58a6096770ed6ab49103a430cc755254a74d9
12 changes: 12 additions & 0 deletions trunk/drivers/target/target_core_transport.c
Original file line number Diff line number Diff line change
Expand Up @@ -3411,6 +3411,18 @@ int transport_generic_map_mem_to_cmd(

if ((cmd->se_cmd_flags & SCF_SCSI_DATA_SG_IO_CDB) ||
(cmd->se_cmd_flags & SCF_SCSI_CONTROL_SG_IO_CDB)) {
/*
* Reject SCSI data overflow with map_mem_to_cmd() as incoming
* scatterlists already have been set to follow what the fabric
* passes for the original expected data transfer length.
*/
if (cmd->se_cmd_flags & SCF_OVERFLOW_BIT) {
pr_warn("Rejecting SCSI DATA overflow for fabric using"
" SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC\n");
cmd->se_cmd_flags |= SCF_SCSI_CDB_EXCEPTION;
cmd->scsi_sense_reason = TCM_INVALID_CDB_FIELD;
return -EINVAL;
}

cmd->t_data_sg = sgl;
cmd->t_data_nents = sgl_count;
Expand Down

0 comments on commit 2939848

Please sign in to comment.