[SCSI] tgt: set the data length properly
scsi_tgt uses REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the length
for us. scsi_tgt needs to do it by itself.
Signed-off-by: FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: James Bottomley <James.Bottomley@HansenPartnership.com>
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index b142514..a0f308b 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -381,6 +381,11 @@
scsi_release_buffers(cmd);
goto unmap_rq;
}
+ /*
+ * we use REQ_TYPE_BLOCK_PC so scsi_init_io doesn't set the
+ * length for us.
+ */
+ cmd->sdb.length = rq->data_len;
return 0;