aboutsummaryrefslogtreecommitdiffstats
path: root/init
diff options
context:
space:
mode:
Diffstat (limited to 'init')
-rw-r--r--init/Kconfig6
-rw-r--r--init/do_mounts.c27
-rw-r--r--init/main.c82
3 files changed, 71 insertions, 44 deletions
diff --git a/init/Kconfig b/init/Kconfig
index 3b5adbf228c7..6135d07f31ec 100644
--- a/init/Kconfig
+++ b/init/Kconfig
@@ -845,9 +845,9 @@ config MODULE_FORCE_LOAD
845 depends on MODULES 845 depends on MODULES
846 default n 846 default n
847 help 847 help
848 This option allows loading of modules even if that would set the 848 Allow loading of modules without version information (ie. modprobe
849 'F' (forced) taint, due to lack of version info. Which is 849 --force). Forced module loading sets the 'F' (forced) taint flag and
850 usually a really bad idea. 850 is usually a really bad idea.
851 851
852config MODULE_UNLOAD 852config MODULE_UNLOAD
853 bool "Module unloading" 853 bool "Module unloading"
diff --git a/init/do_mounts.c b/init/do_mounts.c
index 3885e70e7759..660c1e50c91b 100644
--- a/init/do_mounts.c
+++ b/init/do_mounts.c
@@ -76,6 +76,7 @@ dev_t name_to_dev_t(char *name)
76 char s[32]; 76 char s[32];
77 char *p; 77 char *p;
78 dev_t res = 0; 78 dev_t res = 0;
79 int part;
79 80
80 if (strncmp(name, "/dev/", 5) != 0) { 81 if (strncmp(name, "/dev/", 5) != 0) {
81 unsigned maj, min; 82 unsigned maj, min;
@@ -106,7 +107,31 @@ dev_t name_to_dev_t(char *name)
106 for (p = s; *p; p++) 107 for (p = s; *p; p++)
107 if (*p == '/') 108 if (*p == '/')
108 *p = '!'; 109 *p = '!';
109 res = blk_lookup_devt(s); 110 res = blk_lookup_devt(s, 0);
111 if (res)
112 goto done;
113
114 /*
115 * try non-existant, but valid partition, which may only exist
116 * after revalidating the disk, like partitioned md devices
117 */
118 while (p > s && isdigit(p[-1]))
119 p--;
120 if (p == s || !*p || *p == '0')
121 goto fail;
122
123 /* try disk name without <part number> */
124 part = simple_strtoul(p, NULL, 10);
125 *p = '\0';
126 res = blk_lookup_devt(s, part);
127 if (res)
128 goto done;
129
130 /* try disk name without p<part number> */
131 if (p < s + 2 || !isdigit(p[-2]) || p[-1] != 'p')
132 goto fail;
133 p[-1] = '\0';
134 res = blk_lookup_devt(s, part);
110 if (res) 135 if (res)
111 goto done; 136 goto done;
112 137
diff --git a/init/main.c b/init/main.c
index ddada7acf363..f7fb20021d48 100644
--- a/init/main.c
+++ b/init/main.c
@@ -693,55 +693,57 @@ static int __init initcall_debug_setup(char *str)
693} 693}
694__setup("initcall_debug", initcall_debug_setup); 694__setup("initcall_debug", initcall_debug_setup);
695 695
696extern initcall_t __initcall_start[], __initcall_end[]; 696static void __init do_one_initcall(initcall_t fn)
697
698static void __init do_initcalls(void)
699{ 697{
700 initcall_t *call;
701 int count = preempt_count(); 698 int count = preempt_count();
699 ktime_t t0, t1, delta;
700 char msgbuf[64];
701 int result;
702 702
703 for (call = __initcall_start; call < __initcall_end; call++) { 703 if (initcall_debug) {
704 ktime_t t0, t1, delta; 704 print_fn_descriptor_symbol("calling %s\n", fn);
705 char *msg = NULL; 705 t0 = ktime_get();
706 char msgbuf[40]; 706 }
707 int result;
708 707
709 if (initcall_debug) { 708 result = fn();
710 print_fn_descriptor_symbol("calling %s()\n",
711 (unsigned long) *call);
712 t0 = ktime_get();
713 }
714 709
715 result = (*call)(); 710 if (initcall_debug) {
711 t1 = ktime_get();
712 delta = ktime_sub(t1, t0);
716 713
717 if (initcall_debug) { 714 print_fn_descriptor_symbol("initcall %s", fn);
718 t1 = ktime_get(); 715 printk(" returned %d after %Ld msecs\n", result,
719 delta = ktime_sub(t1, t0); 716 (unsigned long long) delta.tv64 >> 20);
717 }
720 718
721 print_fn_descriptor_symbol("initcall %s()", 719 msgbuf[0] = 0;
722 (unsigned long) *call);
723 printk(" returned %d after %Ld msecs\n", result,
724 (unsigned long long) delta.tv64 >> 20);
725 }
726 720
727 if (result && result != -ENODEV && initcall_debug) { 721 if (result && result != -ENODEV && initcall_debug)
728 sprintf(msgbuf, "error code %d", result); 722 sprintf(msgbuf, "error code %d ", result);
729 msg = msgbuf; 723
730 } 724 if (preempt_count() != count) {
731 if (preempt_count() != count) { 725 strlcat(msgbuf, "preemption imbalance ", sizeof(msgbuf));
732 msg = "preemption imbalance"; 726 preempt_count() = count;
733 preempt_count() = count; 727 }
734 } 728 if (irqs_disabled()) {
735 if (irqs_disabled()) { 729 strlcat(msgbuf, "disabled interrupts ", sizeof(msgbuf));
736 msg = "disabled interrupts"; 730 local_irq_enable();
737 local_irq_enable(); 731 }
738 } 732 if (msgbuf[0]) {
739 if (msg) { 733 print_fn_descriptor_symbol(KERN_WARNING "initcall %s", fn);
740 print_fn_descriptor_symbol(KERN_WARNING "initcall %s()", 734 printk(" returned with %s\n", msgbuf);
741 (unsigned long) *call);
742 printk(" returned with %s\n", msg);
743 }
744 } 735 }
736}
737
738
739extern initcall_t __initcall_start[], __initcall_end[];
740
741static void __init do_initcalls(void)
742{
743 initcall_t *call;
744
745 for (call = __initcall_start; call < __initcall_end; call++)
746 do_one_initcall(*call);
745 747
746 /* Make sure there is no pending stuff from the initcall sequence */ 748 /* Make sure there is no pending stuff from the initcall sequence */
747 flush_scheduled_work(); 749 flush_scheduled_work();