WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [xen-unstable] minios: Fix blkfront grant map leak

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] minios: Fix blkfront grant map leak
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 07 Feb 2008 11:00:24 -0800
Delivery-date: Thu, 07 Feb 2008 11:00:25 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1202375780 0
# Node ID 0672d5b11262be541f12e74e604f10a04d319cfa
# Parent  c9844192c9651aab174d365648acc035897c193b
minios: Fix blkfront grant map leak

Signed-off-by: Samuel Thibault <samuel.thibault@xxxxxxxxxxxxx>
---
 extras/mini-os/blkfront.c         |    6 +++---
 extras/mini-os/include/blkfront.h |    1 +
 2 files changed, 4 insertions(+), 3 deletions(-)

diff -r c9844192c965 -r 0672d5b11262 extras/mini-os/blkfront.c
--- a/extras/mini-os/blkfront.c Thu Feb 07 09:15:59 2008 +0000
+++ b/extras/mini-os/blkfront.c Thu Feb 07 09:16:20 2008 +0000
@@ -258,7 +258,7 @@ void blkfront_aio(struct blkfront_aiocb 
 
     start = (uintptr_t)aiocbp->aio_buf & PAGE_MASK;
     end = ((uintptr_t)aiocbp->aio_buf + aiocbp->aio_nbytes + PAGE_SIZE - 1) & 
PAGE_MASK;
-    n = (end - start) / PAGE_SIZE;
+    aiocbp->n = n = (end - start) / PAGE_SIZE;
 
     /* qemu's IDE max multsect is 16 (8KB) and SCSI max DMA was set to 32KB,
      * so max 44KB can't happen */
@@ -327,8 +327,8 @@ moretodo:
         case BLKIF_OP_WRITE:
         {
             struct blkfront_aiocb *aiocbp = (void*) (uintptr_t) rsp->id;
-            int n = (aiocbp->aio_nbytes + PAGE_SIZE - 1) / PAGE_SIZE, j;
-            for (j = 0; j < n; j++)
+            int j;
+            for (j = 0; j < aiocbp->n; j++)
                 gnttab_end_access(aiocbp->gref[j]);
 
             /* Nota: callback frees aiocbp itself */
diff -r c9844192c965 -r 0672d5b11262 extras/mini-os/include/blkfront.h
--- a/extras/mini-os/include/blkfront.h Thu Feb 07 09:15:59 2008 +0000
+++ b/extras/mini-os/include/blkfront.h Thu Feb 07 09:16:20 2008 +0000
@@ -11,6 +11,7 @@ struct blkfront_aiocb
     void *data;
 
     grant_ref_t gref[BLKIF_MAX_SEGMENTS_PER_REQUEST];
+    int n;
 
     void (*aio_cb)(struct blkfront_aiocb *aiocb, int ret);
 };

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] minios: Fix blkfront grant map leak, Xen patchbot-unstable <=