On 07/04/2016 11:53 PM, [email protected] wrote:
From: Tom Yan <[email protected]>
Define TRIM_RANGE_SIZE and TRIM_RANGE_NUM so that the corresponding
functions can be more generalized. Also, conform SBC by rejecting
Conform to SBC, perhaps?
WRITE SAME (16) commands with number of blocks that exceeds the limit
that is defined in the SATL.
Signed-off-by: Tom Yan <[email protected]>
diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index bfec66f..80d732c 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
[...]
@@ -3305,7 +3308,10 @@ static unsigned int ata_scsi_write_same_xlat(struct
ata_queued_cmd *qc)
goto invalid_param_len;
buf = page_address(sg_page(scsi_sglist(scmd)));
- size = ata_set_lba_range_entries(buf, 512, block, n_block);
+ if (n_block <= TRIM_RANGE_SIZE * TRIM_RANGE_NUM)
+ size = ata_set_lba_range_entries(buf, TRIM_RANGE_NUM, block, n_block);
+ else
+ goto invalid_fld;
CodingStyle: indent with a tab, not spaces.
[...]
MBR, Sergei
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html