]> git.proxmox.com Git - mirror_spl-debian.git/commitdiff
SLES10 Fixes (part 7)
authorBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 May 2009 22:30:13 +0000 (15:30 -0700)
committerBrian Behlendorf <behlendorf1@llnl.gov>
Wed, 20 May 2009 22:30:13 +0000 (15:30 -0700)
- Initial SLES testing uncovered a long standing bug in the debug
  tracing.  The tcd_for_each() macro expected a NULL to terminate
  the trace_data[i] array but this was only ever true due to luck.
  All trace_data[] iterators are now properly capped by TCD_TYPE_MAX.
- SPLAT_MAJOR 229 conflicted with a 'hvc' device on my SLES system.
  Since this was always an arbitrary choice I picked something else.
- The HAVE_PGDAT_LIST case should set pgdat_list_addr to the value stored
  at the address of the memory location returned by kallsyms_lookup_name().

include/splat-ctl.h
include/sys/debug.h
module/spl/spl-debug.c
module/spl/spl-kmem.c

index 82d5c0b506f46d248e9e37dd9e22247b69d4788d..05eb3e8f5a74471a02a5f3cbabfce53f72a3ef19 100644 (file)
@@ -31,7 +31,7 @@
  * and kernelspace portions of splat must agree on.
  */
 
-#define SPLAT_MAJOR                    229 /* XXX - Arbitrary */
+#define SPLAT_MAJOR                    225 /* XXX - Arbitrary */
 #define SPLAT_MINORS                    1
 #define SPLAT_NAME                     "splatctl"
 #define SPLAT_DEV                      "/dev/splatctl"
index 7ceb571d0844b909f4d078195c5009ad9b6600c7..12226a033ec875dfe6fc746bf9c2d6466d4a13e3 100644 (file)
@@ -173,12 +173,12 @@ union trace_data_union {
 extern union trace_data_union (*trace_data[TCD_TYPE_MAX])[NR_CPUS];
 
 #define tcd_for_each(tcd, i, j)                                       \
-    for (i = 0; trace_data[i] != NULL; i++)                           \
+    for (i = 0; i < TCD_TYPE_MAX; i++)                                \
         for (j = 0, ((tcd) = &(*trace_data[i])[j].tcd);               \
              j < num_possible_cpus(); j++, (tcd) = &(*trace_data[i])[j].tcd)
 
 #define tcd_for_each_type_lock(tcd, i, cpu)                           \
-    for (i = 0; trace_data[i] &&                                      \
+    for (i = 0; i < TCD_TYPE_MAX && trace_data[i] &&                  \
          (tcd = &(*trace_data[i])[cpu].tcd) &&                        \
          trace_lock_tcd(tcd); trace_unlock_tcd(tcd), i++)
 
index d2b96b0c346c442a4ca0a22ddde16bccdddf9c88..a60740519f1cd7dc269a67f2870db346521b0081 100644 (file)
@@ -1261,7 +1261,7 @@ trace_fini(void)
                 }
         }
 
-        for (i = 0; trace_data[i] != NULL; i++) {
+        for (i = 0; i < TCD_TYPE_MAX && trace_data[i] != NULL; i++) {
                 kfree(trace_data[i]);
                 trace_data[i] = NULL;
         }
index 4009aa3b2755dfba14c57927692ba69095d2cd6c..4edd3d7e1e6fe48445363da1a42750f3f4896f86 100644 (file)
@@ -1847,7 +1847,7 @@ spl_kmem_init_kallsyms_lookup(void)
 #else /* HAVE_PGDAT_HELPERS */
 
 # ifndef HAVE_PGDAT_LIST
-       pgdat_list_addr = (struct pglist_data *)
+       pgdat_list_addr = *(struct pglist_data **)
                spl_kallsyms_lookup_name("pgdat_list");
        if (!pgdat_list_addr) {
                printk(KERN_ERR "Error: Unknown symbol pgdat_list\n");