summaryrefslogtreecommitdiff
path: root/drivers/scsi/scsi_tgt_lib.c
diff options
context:
space:
mode:
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2008-03-01 09:36:36 +0300
committerJames Bottomley <James.Bottomley@HansenPartnership.com>2008-03-03 22:19:35 +0300
commitcccddc2d15c32bdb6972aaf98f4c9e3e807833df (patch)
treeba849917dd8c20abc0ce9a2d9fe1551699b02122 /drivers/scsi/scsi_tgt_lib.c
parent36802e99894e9757de2441b4f719c05a29495dc5 (diff)
downloadlinux-cccddc2d15c32bdb6972aaf98f4c9e3e807833df.tar.xz
[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>
Diffstat (limited to 'drivers/scsi/scsi_tgt_lib.c')
-rw-r--r--drivers/scsi/scsi_tgt_lib.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_tgt_lib.c b/drivers/scsi/scsi_tgt_lib.c
index b14251483c3b..a0f308bd145b 100644
--- a/drivers/scsi/scsi_tgt_lib.c
+++ b/drivers/scsi/scsi_tgt_lib.c
@@ -381,6 +381,11 @@ static int scsi_map_user_pages(struct scsi_tgt_cmd *tcmd, struct scsi_cmnd *cmd,
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;