diff mbox

[07/19] target: Add support for VERIFY(12) and WRITE AND VERIFY(12)

Message ID 20170504225102.8931-8-bart.vanassche@sandisk.com (mailing list archive)
State New, archived
Headers show

Commit Message

Bart Van Assche May 4, 2017, 10:50 p.m. UTC
Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
Cc: Hannes Reinecke <hare@suse.com>
Cc: Christoph Hellwig <hch@lst.de>
Cc: Andy Grover <agrover@redhat.com>
Cc: David Disseldorp <ddiss@suse.de>
---
 drivers/target/target_core_sbc.c | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Hannes Reinecke May 5, 2017, 6:16 a.m. UTC | #1
On 05/05/2017 12:50 AM, Bart Van Assche wrote:
> Signed-off-by: Bart Van Assche <bart.vanassche@sandisk.com>
> Cc: Hannes Reinecke <hare@suse.com>
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Andy Grover <agrover@redhat.com>
> Cc: David Disseldorp <ddiss@suse.de>
> ---
>  drivers/target/target_core_sbc.c | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
Reviewed-by: Hannes Reinecke <hare@suse.com>

Cheers,

Hannes
Christoph Hellwig May 5, 2017, 9:43 a.m. UTC | #2
Looks fine to me (although it would need adjustments for my version
of patch 6):

Reviewed-by: Christoph Hellwig <hch@lst.de>
--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bart Van Assche May 5, 2017, 5:34 p.m. UTC | #3
On Fri, 2017-05-05 at 11:43 +0200, Christoph Hellwig wrote:
> Looks fine to me (although it would need adjustments for my version
> of patch 6):

Hello Christoph,

Thanks for the review. BTW, if you have a look at sbc_parse_verify() you
will see that if that function succeeds that it sets 'size'. So I think
this patch is fine even with your version of patch 6.

Bart.--
To unsubscribe from this list: send the line "unsubscribe target-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c
index 51489d96cb31..6517ea2c3859 100644
--- a/drivers/target/target_core_sbc.c
+++ b/drivers/target/target_core_sbc.c
@@ -852,6 +852,11 @@  static sense_reason_t sbc_parse_verify(struct se_cmd *cmd, int *sectors,
 		*sectors = transport_get_sectors_10(cdb);
 		cmd->t_task_lba = transport_lba_32(cdb);
 		break;
+	case VERIFY_12:
+	case WRITE_VERIFY_12:
+		*sectors = transport_get_sectors_12(cdb);
+		cmd->t_task_lba = transport_lba_32(cdb);
+		break;
 	case VERIFY_16:
 	case WRITE_VERIFY_16:
 		*sectors = transport_get_sectors_16(cdb);
@@ -967,6 +972,7 @@  sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 		cmd->execute_cmd = sbc_execute_rw;
 		break;
 	case WRITE_VERIFY:
+	case WRITE_VERIFY_12:
 	case WRITE_VERIFY_16:
 		ret = sbc_parse_verify(cmd, &sectors, &size);
 		if (ret)
@@ -1169,6 +1175,7 @@  sbc_parse_cdb(struct se_cmd *cmd, struct sbc_ops *ops)
 			return ret;
 		break;
 	case VERIFY:
+	case VERIFY_12:
 	case VERIFY_16:
 		ret = sbc_parse_verify(cmd, &sectors, &size);
 		if (ret)