Commit 56348560d495 ("debugfs: do not attempt to create a new file before the filesystem is initalized") forbids creating new debugfs files until debugfs is fully initialized. This means that KCSAN's debugfs file creation, which happened at the end of __init(), no longer works. And was apparently never supposed to work! However, there is no reason to create KCSAN's debugfs file so early. This commit therefore moves its creation to a late_initcall() callback.
Unified · Split
| @@ -639,8 +639,6 @@ void __init kcsan_init(void) · 638 unmodified lines | |||
| 639 | 639 | ||
| 640 | BUG_ON(!in_task()); | 640 | BUG_ON(!in_task()); |
| 641 | 641 | ||
| 642 | kcsan_debugfs_init(); | ||
| 643 | |||
| 644 | for_each_possible_cpu(cpu) | 642 | for_each_possible_cpu(cpu) |
| 645 | per_cpu(kcsan_rand_state, cpu) = (u32)get_cycles(); | 643 | per_cpu(kcsan_rand_state, cpu) = (u32)get_cycles(); |
| 646 | 644 | ||
| @@ -261,7 +261,9 @@ static const struct file_operations debugfs_ops = · 260 unmodified lines | |||
| 261 | .release = single_release | 261 | .release = single_release |
| 262 | }; | 262 | }; |
| 263 | 263 | ||
| 264 | void __init kcsan_debugfs_init(void) | 264 | static void __init kcsan_debugfs_init(void) |
| 265 | { | 265 | { |
| 266 | debugfs_create_file("kcsan", 0644, NULL, NULL, &debugfs_ops); | 266 | debugfs_create_file("kcsan", 0644, NULL, NULL, &debugfs_ops); |
| 267 | } | 267 | } |
| 268 | |||
| 269 | late_initcall(kcsan_debugfs_init); | ||
| @@ -30,11 +30,6 @@ extern bool kcsan_enabled; · 29 unmodified lines | |||
| 30 | void kcsan_save_irqtrace(struct task_struct *task); | 30 | void kcsan_save_irqtrace(struct task_struct *task); |
| 31 | void kcsan_restore_irqtrace(struct task_struct *task); | 31 | void kcsan_restore_irqtrace(struct task_struct *task); |
| 32 | 32 | ||
| 33 | /* | ||
| 34 | * Initialize debugfs file. | ||
| 35 | */ | ||
| 36 | void kcsan_debugfs_init(void); | ||
| 37 | |||
| 38 | /* | 33 | /* |
| 39 | * Statistics counters displayed via debugfs; should only be modified in | 34 | * Statistics counters displayed via debugfs; should only be modified in |
| 40 | * slow-paths. | 35 | * slow-paths. |