Skip to contentSkip to conversation

correct grant page unmapping in scsiback

PATCH New [email protected] 1 participant 1 message Jul 1, 2014 Xen hypervisor interface

lore
Share & tools
lore

[email protected]

author maintainer
#0 lore raw

PATCH 1/1 correct grant page unmapping in scsiback

From: Juergen Gross <[email protected]>

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.

drivers/xen/scsiback/scsiback.c +1 -1
diff -r 0251893a7d5a drivers/xen/scsiback/scsiback.c
@@ -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++;