From mboxrd@z Thu Jan 1 00:00:00 1970 From: harry Subject: [PATCH] fast_flush_area in blkback.c still broken after 55194bd55b86 Date: Mon, 07 Nov 2005 11:19:57 +0000 Message-ID: <1131362397.5955.11.camel@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-PvYakLWG2CVzukMEHzF1" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com, keir.fraser@cl.cam.ac.uk List-Id: xen-devel@lists.xenproject.org --=-PvYakLWG2CVzukMEHzF1 Content-Type: text/plain Content-Transfer-Encoding: 7bit I think you need this patch otherwise you will be passing uninitialised data from the stack to GNTTABOP_unmap_grant_ref in fast_flush_area. Also, I think the memset of the pending_grant_handles array should happen before you start using them so I moved it to before blkif_xenbus_init. I'm not sure if this is necessary or it might possibly have to go even earlier. Signed off by Harry Butterworth butterwo@uk.ibm.com. --=-PvYakLWG2CVzukMEHzF1 Content-Disposition: attachment; filename=fast-flush-area.diff Content-Type: text/x-patch; name=fast-flush-area.diff; charset=us-ascii Content-Transfer-Encoding: 7bit diff -r 1a2756a11b6d -r 3951f76667d4 linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c --- a/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Mon Nov 7 10:53:53 2005 +++ b/linux-2.6-xen-sparse/drivers/xen/blkback/blkback.c Mon Nov 7 11:08:33 2005 @@ -114,9 +114,9 @@ handle = pending_handle(idx, i); if (handle == BLKBACK_INVALID_HANDLE) continue; - unmap[i].host_addr = MMAP_VADDR(idx, i); - unmap[i].dev_bus_addr = 0; - unmap[i].handle = handle; + unmap[invcount].host_addr = MMAP_VADDR(idx, i); + unmap[invcount].dev_bus_addr = 0; + unmap[invcount].handle = handle; pending_handle(idx, i) = BLKBACK_INVALID_HANDLE; invcount++; } @@ -516,9 +516,9 @@ ret = kernel_thread(blkio_schedule, 0, CLONE_FS | CLONE_FILES); BUG_ON(ret < 0); + memset(pending_grant_handles, BLKBACK_INVALID_HANDLE, MMAP_PAGES); + blkif_xenbus_init(); - - memset(pending_grant_handles, BLKBACK_INVALID_HANDLE, MMAP_PAGES); return 0; } --=-PvYakLWG2CVzukMEHzF1 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=-PvYakLWG2CVzukMEHzF1--