From: jgross@suse.com Subject: [PATCH][linux 2.6.18] correct grant page unmapping in scsiback Date: Tue, 1 Jul 2014 17:16:38 +0200 Message-ID: <1404227798-12850-1-git-send-email-jgross@suse.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel@lists.xen.org, jbeulich@suse.de Cc: Juergen Gross List-Id: xen-devel@lists.xenproject.org From: Juergen Gross In function scsiback_fast_flush_area() the unmap array is set up with sparse entries in case of some grant pages could not be mapped originally. This can lead to never unmapped grant pages. The unmap array is to be indexed with the so far found number of valid grants, not with the loop variable. Signed-off-by: Juergen Gross diff -r 0251893a7d5a drivers/xen/scsiback/scsiback.c --- a/drivers/xen/scsiback/scsiback.c Mon Jun 16 16:11:33 2014 +0200 +++ b/drivers/xen/scsiback/scsiback.c Tue Jul 01 16:51:11 2014 +0200 @@ -92,7 +92,7 @@ void scsiback_fast_flush_area(pending_re handle = pending_handle(req, i); if (handle == SCSIBACK_INVALID_HANDLE) continue; - gnttab_set_unmap_op(&unmap[i], vaddr(req, i), + gnttab_set_unmap_op(&unmap[invcount], vaddr(req, i), GNTMAP_host_map, handle); pending_handle(req, i) = SCSIBACK_INVALID_HANDLE; invcount++;