Skip to content

Commit eb90e45

Browse files
Roman Bolshakovmartinkpetersen
authored andcommitted
scsi: target: core: Set residuals for 4Kn devices
TCM always fails SBC commands with residuals for 4Kn devices when the command is processed by sbc_parse_cdb(). That prevents residual signalling to the transport driver because residual kind and residual amount aren't set. It also makes residual handling different from 512-byte formatted devices - if there are residuals 512-byte LUN would proceed with command execution while 4K-byte LUN would fail. Link: https://lore.kernel.org/r/[email protected] Based-on: https://patchwork.kernel.org/project/target-devel/patch/[email protected]/ Based-on-patch-by: Bart Van Assche <[email protected]> Signed-off-by: Roman Bolshakov <[email protected]> Signed-off-by: Konstantin Vinogradov <[email protected]> Signed-off-by: Anastasia Kovaleva <[email protected]> Signed-off-by: Martin K. Petersen <[email protected]>
1 parent cd96fe6 commit eb90e45

File tree

1 file changed

+0
-11
lines changed

1 file changed

+0
-11
lines changed

drivers/target/target_core_transport.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1332,17 +1332,6 @@ target_cmd_size_check(struct se_cmd *cmd, unsigned int size)
13321332
return TCM_INVALID_CDB_FIELD;
13331333
}
13341334
}
1335-
/*
1336-
* Reject READ_* or WRITE_* with overflow/underflow for
1337-
* type SCF_SCSI_DATA_CDB.
1338-
*/
1339-
if (dev->dev_attrib.block_size != 512) {
1340-
pr_err("Failing OVERFLOW/UNDERFLOW for LBA op"
1341-
" CDB on non 512-byte sector setup subsystem"
1342-
" plugin: %s\n", dev->transport->name);
1343-
/* Returns CHECK_CONDITION + INVALID_CDB_FIELD */
1344-
return TCM_INVALID_CDB_FIELD;
1345-
}
13461335
/*
13471336
* For the overflow case keep the existing fabric provided
13481337
* ->data_length. Otherwise for the underflow case, reset

0 commit comments

Comments
 (0)