aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Behlendorf <[email protected]>2009-05-20 15:30:13 -0700
committerBrian Behlendorf <[email protected]>2009-05-20 15:30:13 -0700
commit124ca8a5a98a5e64e6a221b5f30c48361dac6f24 (patch)
tree8e7fdafa9a1bd995ba0f6e55ee3474143f01553d
parent5232d256b45b3c48dd96d30b5907c0205192197b (diff)
SLES10 Fixes (part 7)
- 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().
-rw-r--r--include/splat-ctl.h2
-rw-r--r--include/sys/debug.h4
-rw-r--r--module/spl/spl-debug.c2
-rw-r--r--module/spl/spl-kmem.c2
4 files changed, 5 insertions, 5 deletions
diff --git a/include/splat-ctl.h b/include/splat-ctl.h
index 82d5c0b50..05eb3e8f5 100644
--- a/include/splat-ctl.h
+++ b/include/splat-ctl.h
@@ -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"
diff --git a/include/sys/debug.h b/include/sys/debug.h
index 7ceb571d0..12226a033 100644
--- a/include/sys/debug.h
+++ b/include/sys/debug.h
@@ -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++)
diff --git a/module/spl/spl-debug.c b/module/spl/spl-debug.c
index d2b96b0c3..a60740519 100644
--- a/module/spl/spl-debug.c
+++ b/module/spl/spl-debug.c
@@ -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;
}
diff --git a/module/spl/spl-kmem.c b/module/spl/spl-kmem.c
index 4009aa3b2..4edd3d7e1 100644
--- a/module/spl/spl-kmem.c
+++ b/module/spl/spl-kmem.c
@@ -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");