]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.suse/SoN-fix-uninitialized-variable.patch
Move xen patchset to new version's subdir.
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.suse / SoN-fix-uninitialized-variable.patch
diff --git a/src/patches/suse-2.6.27.31/patches.suse/SoN-fix-uninitialized-variable.patch b/src/patches/suse-2.6.27.31/patches.suse/SoN-fix-uninitialized-variable.patch
new file mode 100644 (file)
index 0000000..adeb9b1
--- /dev/null
@@ -0,0 +1,42 @@
+From: Miklos Szeredi <mszeredi@suse.cz>
+Subject: Fix use of uninitialized variable in cache_grow()
+Patch-mainline: no
+References: bnc#444597
+
+This fixes a bug in SoN-08-reserve-slub.patch.
+
+If cache_grow() was called with objp != NULL then the 'reserve' local
+variable wasn't initialized. This resulted in ac->reserve being set to
+a rubbish value.  Due to this in some circumstances huge amounts of
+slab pages were allocated (due to slab_force_alloc() returning true),
+which caused atomic page allocation failures and slowdown of the
+system.
+
+Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
+---
+ mm/slab.c |    5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+Index: linux-2.6.27/mm/slab.c
+===================================================================
+--- linux-2.6.27.orig/mm/slab.c        2008-12-03 22:11:12.000000000 +0100
++++ linux-2.6.27/mm/slab.c     2008-12-03 22:14:37.000000000 +0100
+@@ -2785,7 +2785,7 @@ static int cache_grow(struct kmem_cache
+       size_t offset;
+       gfp_t local_flags;
+       struct kmem_list3 *l3;
+-      int reserve;
++      int reserve = -1;
+       /*
+        * Be lazy and only check for valid flags here,  keeping it out of the
+@@ -2841,7 +2841,8 @@ static int cache_grow(struct kmem_cache
+       if (local_flags & __GFP_WAIT)
+               local_irq_disable();
+       check_irq_off();
+-      slab_set_reserve(cachep, reserve);
++      if (reserve != -1)
++              slab_set_reserve(cachep, reserve);
+       spin_lock(&l3->list_lock);
+       /* Make slab active. */