diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-13 18:02:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-13 18:02:22 -0400 |
commit | b5c851a88a369854c04e511cefb84ea2d0cfa209 (patch) | |
tree | 55084d3d51708f90f27d0a70db5ab63916942f14 /kernel | |
parent | eb02ce017dd83985041a7e54c6449f92d53b026f (diff) | |
parent | 80a04d3f2f94fb68b5df05e3ac6697130bc3467a (diff) |
Merge branch 'linus' into tracing/core
Merge reason: merge latest tracing fixes to avoid conflicts in
kernel/trace/trace_events_filter.c with upcoming change
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/module.c | 3 | ||||
-rw-r--r-- | kernel/mutex.c | 3 | ||||
-rw-r--r-- | kernel/panic.c | 12 | ||||
-rw-r--r-- | kernel/power/disk.c | 8 | ||||
-rw-r--r-- | kernel/power/user.c | 9 | ||||
-rw-r--r-- | kernel/trace/Kconfig | 4 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 12 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 14 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_2.h | 4 |
9 files changed, 54 insertions, 15 deletions
diff --git a/kernel/module.c b/kernel/module.c index 05f014efa32c..e797812a4d95 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -2388,6 +2388,9 @@ SYSCALL_DEFINE3(init_module, void __user *, umod, | |||
2388 | blocking_notifier_call_chain(&module_notify_list, | 2388 | blocking_notifier_call_chain(&module_notify_list, |
2389 | MODULE_STATE_LIVE, mod); | 2389 | MODULE_STATE_LIVE, mod); |
2390 | 2390 | ||
2391 | /* We need to finish all async code before the module init sequence is done */ | ||
2392 | async_synchronize_full(); | ||
2393 | |||
2391 | mutex_lock(&module_mutex); | 2394 | mutex_lock(&module_mutex); |
2392 | /* Drop initial reference. */ | 2395 | /* Drop initial reference. */ |
2393 | module_put(mod); | 2396 | module_put(mod); |
diff --git a/kernel/mutex.c b/kernel/mutex.c index 5d79781394a3..507cf2b5e9f1 100644 --- a/kernel/mutex.c +++ b/kernel/mutex.c | |||
@@ -148,7 +148,8 @@ __mutex_lock_common(struct mutex *lock, long state, unsigned int subclass, | |||
148 | 148 | ||
149 | preempt_disable(); | 149 | preempt_disable(); |
150 | mutex_acquire(&lock->dep_map, subclass, 0, ip); | 150 | mutex_acquire(&lock->dep_map, subclass, 0, ip); |
151 | #if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) | 151 | #if defined(CONFIG_SMP) && !defined(CONFIG_DEBUG_MUTEXES) && \ |
152 | !defined(CONFIG_HAVE_DEFAULT_NO_SPIN_MUTEXES) | ||
152 | /* | 153 | /* |
153 | * Optimistic spinning. | 154 | * Optimistic spinning. |
154 | * | 155 | * |
diff --git a/kernel/panic.c b/kernel/panic.c index 3fd8c5bf8b39..934fb377f4b3 100644 --- a/kernel/panic.c +++ b/kernel/panic.c | |||
@@ -213,8 +213,16 @@ unsigned long get_taint(void) | |||
213 | 213 | ||
214 | void add_taint(unsigned flag) | 214 | void add_taint(unsigned flag) |
215 | { | 215 | { |
216 | /* can't trust the integrity of the kernel anymore: */ | 216 | /* |
217 | debug_locks = 0; | 217 | * Can't trust the integrity of the kernel anymore. |
218 | * We don't call directly debug_locks_off() because the issue | ||
219 | * is not necessarily serious enough to set oops_in_progress to 1 | ||
220 | * Also we want to keep up lockdep for staging development and | ||
221 | * post-warning case. | ||
222 | */ | ||
223 | if (flag != TAINT_CRAP && flag != TAINT_WARN && __debug_locks_off()) | ||
224 | printk(KERN_WARNING "Disabling lockdep due to kernel taint\n"); | ||
225 | |||
218 | set_bit(flag, &tainted_mask); | 226 | set_bit(flag, &tainted_mask); |
219 | } | 227 | } |
220 | EXPORT_SYMBOL(add_taint); | 228 | EXPORT_SYMBOL(add_taint); |
diff --git a/kernel/power/disk.c b/kernel/power/disk.c index 5f21ab2bbcdf..0854770b63b9 100644 --- a/kernel/power/disk.c +++ b/kernel/power/disk.c | |||
@@ -22,6 +22,7 @@ | |||
22 | #include <linux/console.h> | 22 | #include <linux/console.h> |
23 | #include <linux/cpu.h> | 23 | #include <linux/cpu.h> |
24 | #include <linux/freezer.h> | 24 | #include <linux/freezer.h> |
25 | #include <scsi/scsi_scan.h> | ||
25 | #include <asm/suspend.h> | 26 | #include <asm/suspend.h> |
26 | 27 | ||
27 | #include "power.h" | 28 | #include "power.h" |
@@ -645,6 +646,13 @@ static int software_resume(void) | |||
645 | return 0; | 646 | return 0; |
646 | 647 | ||
647 | /* | 648 | /* |
649 | * We can't depend on SCSI devices being available after loading one of | ||
650 | * their modules if scsi_complete_async_scans() is not called and the | ||
651 | * resume device usually is a SCSI one. | ||
652 | */ | ||
653 | scsi_complete_async_scans(); | ||
654 | |||
655 | /* | ||
648 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs | 656 | * name_to_dev_t() below takes a sysfs buffer mutex when sysfs |
649 | * is configured into the kernel. Since the regular hibernate | 657 | * is configured into the kernel. Since the regular hibernate |
650 | * trigger path is via sysfs which takes a buffer mutex before | 658 | * trigger path is via sysfs which takes a buffer mutex before |
diff --git a/kernel/power/user.c b/kernel/power/user.c index 6c85359364f2..ed97375daae9 100644 --- a/kernel/power/user.c +++ b/kernel/power/user.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/cpu.h> | 24 | #include <linux/cpu.h> |
25 | #include <linux/freezer.h> | 25 | #include <linux/freezer.h> |
26 | #include <linux/smp_lock.h> | 26 | #include <linux/smp_lock.h> |
27 | #include <scsi/scsi_scan.h> | ||
27 | 28 | ||
28 | #include <asm/uaccess.h> | 29 | #include <asm/uaccess.h> |
29 | 30 | ||
@@ -92,6 +93,7 @@ static int snapshot_open(struct inode *inode, struct file *filp) | |||
92 | filp->private_data = data; | 93 | filp->private_data = data; |
93 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); | 94 | memset(&data->handle, 0, sizeof(struct snapshot_handle)); |
94 | if ((filp->f_flags & O_ACCMODE) == O_RDONLY) { | 95 | if ((filp->f_flags & O_ACCMODE) == O_RDONLY) { |
96 | /* Hibernating. The image device should be accessible. */ | ||
95 | data->swap = swsusp_resume_device ? | 97 | data->swap = swsusp_resume_device ? |
96 | swap_type_of(swsusp_resume_device, 0, NULL) : -1; | 98 | swap_type_of(swsusp_resume_device, 0, NULL) : -1; |
97 | data->mode = O_RDONLY; | 99 | data->mode = O_RDONLY; |
@@ -99,6 +101,13 @@ static int snapshot_open(struct inode *inode, struct file *filp) | |||
99 | if (error) | 101 | if (error) |
100 | pm_notifier_call_chain(PM_POST_HIBERNATION); | 102 | pm_notifier_call_chain(PM_POST_HIBERNATION); |
101 | } else { | 103 | } else { |
104 | /* | ||
105 | * Resuming. We may need to wait for the image device to | ||
106 | * appear. | ||
107 | */ | ||
108 | wait_for_device_probe(); | ||
109 | scsi_complete_async_scans(); | ||
110 | |||
102 | data->swap = -1; | 111 | data->swap = -1; |
103 | data->mode = O_WRONLY; | 112 | data->mode = O_WRONLY; |
104 | error = pm_notifier_call_chain(PM_RESTORE_PREPARE); | 113 | error = pm_notifier_call_chain(PM_RESTORE_PREPARE); |
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 644606e899fa..57981d338d1f 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -317,7 +317,7 @@ config KMEMTRACE | |||
317 | and profile kernel code. | 317 | and profile kernel code. |
318 | 318 | ||
319 | This requires an userspace application to use. See | 319 | This requires an userspace application to use. See |
320 | Documentation/vm/kmemtrace.txt for more information. | 320 | Documentation/trace/kmemtrace.txt for more information. |
321 | 321 | ||
322 | Saying Y will make the kernel somewhat larger and slower. However, | 322 | Saying Y will make the kernel somewhat larger and slower. However, |
323 | if you disable kmemtrace at run-time or boot-time, the performance | 323 | if you disable kmemtrace at run-time or boot-time, the performance |
@@ -422,7 +422,7 @@ config MMIOTRACE | |||
422 | implementation and works via page faults. Tracing is disabled by | 422 | implementation and works via page faults. Tracing is disabled by |
423 | default and can be enabled at run-time. | 423 | default and can be enabled at run-time. |
424 | 424 | ||
425 | See Documentation/tracers/mmiotrace.txt. | 425 | See Documentation/trace/mmiotrace.txt. |
426 | If you are not helping to develop drivers, say N. | 426 | If you are not helping to develop drivers, say N. |
427 | 427 | ||
428 | config MMIOTRACE_TEST | 428 | config MMIOTRACE_TEST |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index be9299a53e2a..789e14eb09a5 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -503,6 +503,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
503 | 503 | ||
504 | if (copy_from_user(&buf, ubuf, cnt)) | 504 | if (copy_from_user(&buf, ubuf, cnt)) |
505 | return -EFAULT; | 505 | return -EFAULT; |
506 | buf[cnt] = '\0'; | ||
506 | 507 | ||
507 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); | 508 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); |
508 | if (!pred) | 509 | if (!pred) |
@@ -520,9 +521,10 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
520 | return cnt; | 521 | return cnt; |
521 | } | 522 | } |
522 | 523 | ||
523 | if (filter_add_pred(call, pred)) { | 524 | err = filter_add_pred(call, pred); |
525 | if (err < 0) { | ||
524 | filter_free_pred(pred); | 526 | filter_free_pred(pred); |
525 | return -EINVAL; | 527 | return err; |
526 | } | 528 | } |
527 | 529 | ||
528 | *ppos += cnt; | 530 | *ppos += cnt; |
@@ -569,6 +571,7 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
569 | 571 | ||
570 | if (copy_from_user(&buf, ubuf, cnt)) | 572 | if (copy_from_user(&buf, ubuf, cnt)) |
571 | return -EFAULT; | 573 | return -EFAULT; |
574 | buf[cnt] = '\0'; | ||
572 | 575 | ||
573 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); | 576 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); |
574 | if (!pred) | 577 | if (!pred) |
@@ -586,10 +589,11 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
586 | return cnt; | 589 | return cnt; |
587 | } | 590 | } |
588 | 591 | ||
589 | if (filter_add_subsystem_pred(system, pred)) { | 592 | err = filter_add_subsystem_pred(system, pred); |
593 | if (err < 0) { | ||
590 | filter_free_subsystem_preds(system); | 594 | filter_free_subsystem_preds(system); |
591 | filter_free_pred(pred); | 595 | filter_free_pred(pred); |
592 | return -EINVAL; | 596 | return err; |
593 | } | 597 | } |
594 | 598 | ||
595 | *ppos += cnt; | 599 | *ppos += cnt; |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 470ad9487ecc..9f8ecca34a59 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -215,7 +215,7 @@ static int __filter_add_pred(struct ftrace_event_call *call, | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | return -ENOMEM; | 218 | return -ENOSPC; |
219 | } | 219 | } |
220 | 220 | ||
221 | static int is_string_field(const char *type) | 221 | static int is_string_field(const char *type) |
@@ -319,7 +319,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, | |||
319 | } | 319 | } |
320 | 320 | ||
321 | if (i == MAX_FILTER_PRED) | 321 | if (i == MAX_FILTER_PRED) |
322 | return -EINVAL; | 322 | return -ENOSPC; |
323 | 323 | ||
324 | events_for_each(call) { | 324 | events_for_each(call) { |
325 | int err; | 325 | int err; |
@@ -410,16 +410,22 @@ int filter_parse(char **pbuf, struct filter_pred *pred) | |||
410 | } | 410 | } |
411 | } | 411 | } |
412 | 412 | ||
413 | if (!val_str) { | ||
414 | pred->field_name = NULL; | ||
415 | return -EINVAL; | ||
416 | } | ||
417 | |||
413 | pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); | 418 | pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); |
414 | if (!pred->field_name) | 419 | if (!pred->field_name) |
415 | return -ENOMEM; | 420 | return -ENOMEM; |
416 | 421 | ||
417 | pred->val = simple_strtoull(val_str, &tmp, 10); | 422 | pred->val = simple_strtoull(val_str, &tmp, 0); |
418 | if (tmp == val_str) { | 423 | if (tmp == val_str) { |
419 | pred->str_val = kstrdup(val_str, GFP_KERNEL); | 424 | pred->str_val = kstrdup(val_str, GFP_KERNEL); |
420 | if (!pred->str_val) | 425 | if (!pred->str_val) |
421 | return -ENOMEM; | 426 | return -ENOMEM; |
422 | } | 427 | } else if (*tmp != '\0') |
428 | return -EINVAL; | ||
423 | 429 | ||
424 | return 0; | 430 | return 0; |
425 | } | 431 | } |
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h index 1c94b87c7180..02fb710193ed 100644 --- a/kernel/trace/trace_events_stage_2.h +++ b/kernel/trace/trace_events_stage_2.h | |||
@@ -105,10 +105,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
105 | return 0; | 105 | return 0; |
106 | 106 | ||
107 | #undef __entry | 107 | #undef __entry |
108 | #define __entry "REC" | 108 | #define __entry REC |
109 | 109 | ||
110 | #undef TP_printk | 110 | #undef TP_printk |
111 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, #args | 111 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) |
112 | 112 | ||
113 | #undef TP_fast_assign | 113 | #undef TP_fast_assign |
114 | #define TP_fast_assign(args...) args | 114 | #define TP_fast_assign(args...) args |