[SCSI] tgt: set the data length properly
authorFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Sat, 1 Mar 2008 06:36:36 +0000 (15:36 +0900)
committerJames Bottomley <James.Bottomley@HansenPartnership.com>
Mon, 3 Mar 2008 19:19:35 +0000 (13:19 -0600)
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>
drivers/scsi/scsi_tgt_lib.c

index b142514..a0f308b 100644 (file)
@@ -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;