diff options
Diffstat (limited to 'drivers/target/target_core_sbc.c')
-rw-r--r-- | drivers/target/target_core_sbc.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 1d3a626bf24f..bd78d9235ac6 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c | |||
@@ -647,8 +647,19 @@ sbc_check_prot(struct se_device *dev, struct se_cmd *cmd, unsigned char *cdb, | |||
647 | 647 | ||
648 | cmd->prot_type = dev->dev_attrib.pi_prot_type; | 648 | cmd->prot_type = dev->dev_attrib.pi_prot_type; |
649 | cmd->prot_length = dev->prot_length * sectors; | 649 | cmd->prot_length = dev->prot_length * sectors; |
650 | pr_debug("%s: prot_type=%d, prot_length=%d prot_op=%d prot_checks=%d\n", | 650 | |
651 | __func__, cmd->prot_type, cmd->prot_length, | 651 | /** |
652 | * In case protection information exists over the wire | ||
653 | * we modify command data length to describe pure data. | ||
654 | * The actual transfer length is data length + protection | ||
655 | * length | ||
656 | **/ | ||
657 | if (protect) | ||
658 | cmd->data_length = sectors * dev->dev_attrib.block_size; | ||
659 | |||
660 | pr_debug("%s: prot_type=%d, data_length=%d, prot_length=%d " | ||
661 | "prot_op=%d prot_checks=%d\n", | ||
662 | __func__, cmd->prot_type, cmd->data_length, cmd->prot_length, | ||
652 | cmd->prot_op, cmd->prot_checks); | 663 | cmd->prot_op, cmd->prot_checks); |
653 | 664 | ||
654 | return true; | 665 | return true; |