Backport of fix for kernel crash bug
Sapan Bhatia [Wed, 29 Aug 2012 09:30:54 +0000 (05:30 -0400)]
kernel-2.6.spec
linux-2.6-002-divide-by-zero-fix.patch [new file with mode: 0644]

index 9d48fcb..03dd6ab 100644 (file)
@@ -14,11 +14,7 @@ URL: %{SCMURL}
 
 %define sublevel 32
 
-%if ("%{distro}" == "Fedora" && %{distrorelease} >= 12) || ("%{distro}" == "SL" && %{distrorelease} >= 6) || ("%{distro}" == "CentOS" && %{distrorelease} >= 6)
 %define modern_distro 1
-%else
-%define modern_distro 0
-%endif
 #### Planet-Lab ####
 
 Summary: The Linux kernel
@@ -981,6 +977,7 @@ make -f %{SOURCE20} VERSION=%{version} configs
 
 #### Planet-Lab ####
 ApplyPatch linux-2.6-001-bcm5720.patch
+ApplyPatch linux-2.6-002-divide-by-zero-fix.patch
 ApplyPatch patch-2.6.32-131.0.15.el6-vs2.3.0.36.29.6.diff
 ApplyPatch linux-2.6-255-vserver-delta-cow-fix23.patch
 ApplyPatch linux-2.6-250-ipsets.patch
diff --git a/linux-2.6-002-divide-by-zero-fix.patch b/linux-2.6-002-divide-by-zero-fix.patch
new file mode 100644 (file)
index 0000000..6f79e43
--- /dev/null
@@ -0,0 +1,13 @@
+diff -up linux-2.6.32-33.planetlab.x86_64/kernel/sched.c.orig linux-2.6.32-33.planetlab.x86_64/kernel/sched.c
+--- linux-2.6.32-33.planetlab.x86_64/kernel/sched.c.orig       2012-08-29 05:08:16.000000000 -0400
++++ linux-2.6.32-33.planetlab.x86_64/kernel/sched.c    2012-08-29 05:25:03.150631094 -0400
+@@ -4058,6 +4058,9 @@ static void update_group_power(struct sc
+               group = group->next;
+       } while (group != child->groups);
++    if (!power)
++              power = 1;
++
+       sdg->cpu_power = power;
+ }