All of lore.kernel.org
 help / color / mirror / Atom feed
From: harry <harry@hebutterworth.freeserve.co.uk>
To: xen-devel@lists.xensource.com, keir.fraser@cl.cam.ac.uk
Subject: [PATCH] fast_flush_area in blkback.c still broken after 55194bd55b86
Date: Mon, 07 Nov 2005 11:19:57 +0000	[thread overview]
Message-ID: <1131362397.5955.11.camel@localhost.localdomain> (raw)

[-- Attachment #1: Type: text/plain, Size: 421 bytes --]

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.

[-- Attachment #2: fast-flush-area.diff --]
[-- Type: text/x-patch, Size: 983 bytes --]

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;
 }

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

             reply	other threads:[~2005-11-07 11:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-07 11:19 harry [this message]
2005-11-07 12:01 ` [PATCH] fast_flush_area in blkback.c still broken after 55194bd55b86 Keir Fraser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1131362397.5955.11.camel@localhost.localdomain \
    --to=harry@hebutterworth.freeserve.co.uk \
    --cc=keir.fraser@cl.cam.ac.uk \
    --cc=xen-devel@lists.xensource.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.