提交 67768f67 编写于 作者: F FUJITA Tomonori 提交者: James Bottomley

[SCSI] ps3rom: fix wrong resid calculation bug

sg driver rounds up the length in struct scatterlist to be a multiple
of 512 in some conditions. So LLDs can't use the data length in a sg
list to calculate residual. Instead, the length in struct scsi_cmnd
should be used.

[Geert: the variable buflen already contains scsi_bufflen(cmd)]
Signed-off-by: NFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>
Signed-off-by: NGeert Uytterhoeven <Geert.Uytterhoeven@sonycom.com>
Signed-off-by: NJames Bottomley <James.Bottomley@HansenPartnership.com>
上级 00da714b
......@@ -124,7 +124,7 @@ static int fill_from_dev_buffer(struct scsi_cmnd *cmd, const void *buf)
}
req_len += sgpnt->length;
}
scsi_set_resid(cmd, req_len - act_len);
scsi_set_resid(cmd, buflen - act_len);
return 0;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册