提交 77c5ceaf 编写于 作者: H Hank Janssen 提交者: Greg Kroah-Hartman

staging: hv: Fixed lockup problem with bounce_buffer scatter list

Fixed lockup problem with bounce_buffer scatter list which caused
crashes in heavy loads. And minor code indentation cleanup in effected
area.

Removed whitespace and noted minor indentation changes in description as
pointed out by Joe Perches. (Thanks for reviewing Joe)
Signed-off-by: NHank Janssen <hjanssen@microsoft.com>
Signed-off-by: NHaiyang Zhang <haiyangz@microsoft.com>
Cc: stable <stable@kernel.org>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 15dd1c9f
...@@ -615,6 +615,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, ...@@ -615,6 +615,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
unsigned int request_size = 0; unsigned int request_size = 0;
int i; int i;
struct scatterlist *sgl; struct scatterlist *sgl;
unsigned int sg_count = 0;
DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d " DPRINT_DBG(STORVSC_DRV, "scmnd %p dir %d, use_sg %d buf %p len %d "
"queue depth %d tagged %d", scmnd, scmnd->sc_data_direction, "queue depth %d tagged %d", scmnd, scmnd->sc_data_direction,
...@@ -697,6 +698,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, ...@@ -697,6 +698,7 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
request->DataBuffer.Length = scsi_bufflen(scmnd); request->DataBuffer.Length = scsi_bufflen(scmnd);
if (scsi_sg_count(scmnd)) { if (scsi_sg_count(scmnd)) {
sgl = (struct scatterlist *)scsi_sglist(scmnd); sgl = (struct scatterlist *)scsi_sglist(scmnd);
sg_count = scsi_sg_count(scmnd);
/* check if we need to bounce the sgl */ /* check if we need to bounce the sgl */
if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) { if (do_bounce_buffer(sgl, scsi_sg_count(scmnd)) != -1) {
...@@ -731,11 +733,12 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd, ...@@ -731,11 +733,12 @@ static int storvsc_queuecommand(struct scsi_cmnd *scmnd,
scsi_sg_count(scmnd)); scsi_sg_count(scmnd));
sgl = cmd_request->bounce_sgl; sgl = cmd_request->bounce_sgl;
sg_count = cmd_request->bounce_sgl_count;
} }
request->DataBuffer.Offset = sgl[0].offset; request->DataBuffer.Offset = sgl[0].offset;
for (i = 0; i < scsi_sg_count(scmnd); i++) { for (i = 0; i < sg_count; i++) {
DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n", DPRINT_DBG(STORVSC_DRV, "sgl[%d] len %d offset %d\n",
i, sgl[i].length, sgl[i].offset); i, sgl[i].length, sgl[i].offset);
request->DataBuffer.PfnArray[i] = request->DataBuffer.PfnArray[i] =
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册