From 9a8b7a5f6727575472917026f462bd357b759689 Mon Sep 17 00:00:00 2001 From: Bart Van Assche Date: Wed, 2 Jan 2013 18:47:56 +0000 Subject: [PATCH] scst: Avoid that scst_adjust_sg() truncates requests above 512 KB (merge r4668 from trunk) git-svn-id: http://svn.code.sf.net/p/scst/svn/branches/2.2.x@4674 d57e44dd-8a1f-0410-8b47-8ef2f437770f --- scst/src/scst_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scst/src/scst_lib.c b/scst/src/scst_lib.c index 964ea7db3..a7a0cee93 100644 --- a/scst/src/scst_lib.c +++ b/scst/src/scst_lib.c @@ -2078,7 +2078,7 @@ static void scst_adjust_sg(struct scst_cmd *cmd, struct scatterlist *sg, cmd->orig_sg_cnt = *sg_cnt; cmd->orig_sg_entry = j; cmd->orig_entry_len = sg[j].length; - *sg_cnt = (left > 0) ? j+1 : j; + *sg_cnt = (left > 0) ? i+1 : i; sg[j].length = left; cmd->sg_buff_modified = 1; break;