[kernel] r14317 - in dists/lenny/linux-2.6/debian: . patches/bugfix/all patches/series
Ben Hutchings
benh at alioth.debian.org
Sun Oct 4 03:51:08 UTC 2009
Author: benh
Date: Sun Oct 4 03:51:06 2009
New Revision: 14317
Log:
virtio_balloon: Fix towards_target when deflating balloon (Closes: #544619)
Added:
dists/lenny/linux-2.6/debian/patches/bugfix/all/virtio_balloon-fix-towards_target-when-deflating.patch
Modified:
dists/lenny/linux-2.6/debian/changelog
dists/lenny/linux-2.6/debian/patches/series/20
Modified: dists/lenny/linux-2.6/debian/changelog
==============================================================================
--- dists/lenny/linux-2.6/debian/changelog Sun Oct 4 01:42:34 2009 (r14316)
+++ dists/lenny/linux-2.6/debian/changelog Sun Oct 4 03:51:06 2009 (r14317)
@@ -7,6 +7,8 @@
(Closes: #515982)
* hppa: Ensure TLB purge runs single threaded (Closes: #539215),
thanks to Helge Deller <deller at gmx.de>
+ * virtio_balloon: Fix towards_target when deflating balloon
+ (Closes: #544619)
[ dann frazier ]
* autofs4: don't make expiring dentry negative, avoiding an oops
Added: dists/lenny/linux-2.6/debian/patches/bugfix/all/virtio_balloon-fix-towards_target-when-deflating.patch
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ dists/lenny/linux-2.6/debian/patches/bugfix/all/virtio_balloon-fix-towards_target-when-deflating.patch Sun Oct 4 03:51:06 2009 (r14317)
@@ -0,0 +1,38 @@
+From 532a6086e35fa3b5761e68af36d4e42a550eba15 Mon Sep 17 00:00:00 2001
+From: Anthony Liguori <aliguori at us.ibm.com>
+Date: Mon, 18 Aug 2008 17:15:31 -0500
+Subject: [PATCH] virtio_balloon: fix towards_target when deflating balloon
+
+Both v and vb->num_pages are u32 and unsigned int respectively. If v is less
+than vb->num_pages (and it is, when deflating the balloon), the result is a
+very large 32-bit number. Since we're returning a s64, instead of getting the
+same negative number we desire, we get a very large positive number.
+
+This handles the case where v < vb->num_pages and ensures we get a small,
+negative, s64 as the result.
+
+Rusty: please push this for 2.6.27-rc4. It's probably appropriate for the
+stable tree too as it will cause an unexpected OOM when ballooning.
+
+Signed-off-by: Anthony Liguori <aliguori at us.ibm.com>
+Signed-off-by: Rusty Russell <rusty at rustcorp.com.au> (simplified)
+---
+ drivers/virtio/virtio_balloon.c | 2 +-
+ 1 files changed, 1 insertions(+), 1 deletions(-)
+
+diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
+index bfef604..62eab43 100644
+--- a/drivers/virtio/virtio_balloon.c
++++ b/drivers/virtio/virtio_balloon.c
+@@ -158,7 +158,7 @@ static inline s64 towards_target(struct virtio_balloon *vb)
+ vb->vdev->config->get(vb->vdev,
+ offsetof(struct virtio_balloon_config, num_pages),
+ &v, sizeof(v));
+- return v - vb->num_pages;
++ return (s64)v - vb->num_pages;
+ }
+
+ static void update_balloon_size(struct virtio_balloon *vb)
+--
+1.6.4.3
+
Modified: dists/lenny/linux-2.6/debian/patches/series/20
==============================================================================
--- dists/lenny/linux-2.6/debian/patches/series/20 Sun Oct 4 01:42:34 2009 (r14316)
+++ dists/lenny/linux-2.6/debian/patches/series/20 Sun Oct 4 03:51:06 2009 (r14317)
@@ -2,4 +2,5 @@
+ bugfix/x86/fix-alternatives-on-486.patch
+ bugfix/mips/ip22-no-early-printk.patch
+ bugfix/parisc/ensure-tlb-purge-runs-single-threaded.patch
++ bugfix/all/virtio_balloon-fix-towards_target-when-deflating.patch
+ features/all/ftdi_sio-openrd.patch
More information about the Kernel-svn-changes
mailing list