diff options
author | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-21 14:05:45 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-03-21 14:05:45 -0500 |
commit | d04cdb64212eb5ae6a98026a97dda626e40e8e9a (patch) | |
tree | b6a7dbb21ccfceb915844e9a330b3d3dfcaf3c5b /kernel | |
parent | 2f8600dff2b140096a7df781884e918a16aa90e0 (diff) | |
parent | ec1248e70edc5cf7b485efcc7b41e44e10f422e5 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/exit.c | 7 | ||||
-rw-r--r-- | kernel/fork.c | 6 | ||||
-rw-r--r-- | kernel/ksysfs.c | 3 | ||||
-rw-r--r-- | kernel/module.c | 199 | ||||
-rw-r--r-- | kernel/params.c | 10 | ||||
-rw-r--r-- | kernel/posix-timers.c | 1 | ||||
-rw-r--r-- | kernel/rcupdate.c | 6 | ||||
-rw-r--r-- | kernel/timer.c | 4 |
8 files changed, 132 insertions, 104 deletions
diff --git a/kernel/exit.c b/kernel/exit.c index 531aadca5530..d1e8d500a7e1 100644 --- a/kernel/exit.c +++ b/kernel/exit.c | |||
@@ -807,8 +807,6 @@ fastcall NORET_TYPE void do_exit(long code) | |||
807 | panic("Attempted to kill the idle task!"); | 807 | panic("Attempted to kill the idle task!"); |
808 | if (unlikely(tsk->pid == 1)) | 808 | if (unlikely(tsk->pid == 1)) |
809 | panic("Attempted to kill init!"); | 809 | panic("Attempted to kill init!"); |
810 | if (tsk->io_context) | ||
811 | exit_io_context(); | ||
812 | 810 | ||
813 | if (unlikely(current->ptrace & PT_TRACE_EXIT)) { | 811 | if (unlikely(current->ptrace & PT_TRACE_EXIT)) { |
814 | current->ptrace_message = code; | 812 | current->ptrace_message = code; |
@@ -822,6 +820,8 @@ fastcall NORET_TYPE void do_exit(long code) | |||
822 | if (unlikely(tsk->flags & PF_EXITING)) { | 820 | if (unlikely(tsk->flags & PF_EXITING)) { |
823 | printk(KERN_ALERT | 821 | printk(KERN_ALERT |
824 | "Fixing recursive fault but reboot is needed!\n"); | 822 | "Fixing recursive fault but reboot is needed!\n"); |
823 | if (tsk->io_context) | ||
824 | exit_io_context(); | ||
825 | set_current_state(TASK_UNINTERRUPTIBLE); | 825 | set_current_state(TASK_UNINTERRUPTIBLE); |
826 | schedule(); | 826 | schedule(); |
827 | } | 827 | } |
@@ -881,6 +881,9 @@ fastcall NORET_TYPE void do_exit(long code) | |||
881 | */ | 881 | */ |
882 | mutex_debug_check_no_locks_held(tsk); | 882 | mutex_debug_check_no_locks_held(tsk); |
883 | 883 | ||
884 | if (tsk->io_context) | ||
885 | exit_io_context(); | ||
886 | |||
884 | /* PF_DEAD causes final put_task_struct after we schedule. */ | 887 | /* PF_DEAD causes final put_task_struct after we schedule. */ |
885 | preempt_disable(); | 888 | preempt_disable(); |
886 | BUG_ON(tsk->flags & PF_DEAD); | 889 | BUG_ON(tsk->flags & PF_DEAD); |
diff --git a/kernel/fork.c b/kernel/fork.c index ccdfbb16c86d..b373322ca497 100644 --- a/kernel/fork.c +++ b/kernel/fork.c | |||
@@ -1478,9 +1478,7 @@ static int unshare_vm(unsigned long unshare_flags, struct mm_struct **new_mmp) | |||
1478 | 1478 | ||
1479 | if ((unshare_flags & CLONE_VM) && | 1479 | if ((unshare_flags & CLONE_VM) && |
1480 | (mm && atomic_read(&mm->mm_users) > 1)) { | 1480 | (mm && atomic_read(&mm->mm_users) > 1)) { |
1481 | *new_mmp = dup_mm(current); | 1481 | return -EINVAL; |
1482 | if (!*new_mmp) | ||
1483 | return -ENOMEM; | ||
1484 | } | 1482 | } |
1485 | 1483 | ||
1486 | return 0; | 1484 | return 0; |
@@ -1569,7 +1567,7 @@ asmlinkage long sys_unshare(unsigned long unshare_flags) | |||
1569 | 1567 | ||
1570 | if (new_sigh) { | 1568 | if (new_sigh) { |
1571 | sigh = current->sighand; | 1569 | sigh = current->sighand; |
1572 | current->sighand = new_sigh; | 1570 | rcu_assign_pointer(current->sighand, new_sigh); |
1573 | new_sigh = sigh; | 1571 | new_sigh = sigh; |
1574 | } | 1572 | } |
1575 | 1573 | ||
diff --git a/kernel/ksysfs.c b/kernel/ksysfs.c index d5eeae0fa5bc..f2690ed74530 100644 --- a/kernel/ksysfs.c +++ b/kernel/ksysfs.c | |||
@@ -15,9 +15,6 @@ | |||
15 | #include <linux/module.h> | 15 | #include <linux/module.h> |
16 | #include <linux/init.h> | 16 | #include <linux/init.h> |
17 | 17 | ||
18 | u64 uevent_seqnum; | ||
19 | char uevent_helper[UEVENT_HELPER_PATH_LEN] = "/sbin/hotplug"; | ||
20 | |||
21 | #define KERNEL_ATTR_RO(_name) \ | 18 | #define KERNEL_ATTR_RO(_name) \ |
22 | static struct subsys_attribute _name##_attr = __ATTR_RO(_name) | 19 | static struct subsys_attribute _name##_attr = __ATTR_RO(_name) |
23 | 20 | ||
diff --git a/kernel/module.c b/kernel/module.c index 5aad477ddc79..77764f22f021 100644 --- a/kernel/module.c +++ b/kernel/module.c | |||
@@ -126,8 +126,11 @@ extern const struct kernel_symbol __start___ksymtab[]; | |||
126 | extern const struct kernel_symbol __stop___ksymtab[]; | 126 | extern const struct kernel_symbol __stop___ksymtab[]; |
127 | extern const struct kernel_symbol __start___ksymtab_gpl[]; | 127 | extern const struct kernel_symbol __start___ksymtab_gpl[]; |
128 | extern const struct kernel_symbol __stop___ksymtab_gpl[]; | 128 | extern const struct kernel_symbol __stop___ksymtab_gpl[]; |
129 | extern const struct kernel_symbol __start___ksymtab_gpl_future[]; | ||
130 | extern const struct kernel_symbol __stop___ksymtab_gpl_future[]; | ||
129 | extern const unsigned long __start___kcrctab[]; | 131 | extern const unsigned long __start___kcrctab[]; |
130 | extern const unsigned long __start___kcrctab_gpl[]; | 132 | extern const unsigned long __start___kcrctab_gpl[]; |
133 | extern const unsigned long __start___kcrctab_gpl_future[]; | ||
131 | 134 | ||
132 | #ifndef CONFIG_MODVERSIONS | 135 | #ifndef CONFIG_MODVERSIONS |
133 | #define symversion(base, idx) NULL | 136 | #define symversion(base, idx) NULL |
@@ -135,6 +138,18 @@ extern const unsigned long __start___kcrctab_gpl[]; | |||
135 | #define symversion(base, idx) ((base) ? ((base) + (idx)) : NULL) | 138 | #define symversion(base, idx) ((base) ? ((base) + (idx)) : NULL) |
136 | #endif | 139 | #endif |
137 | 140 | ||
141 | /* lookup symbol in given range of kernel_symbols */ | ||
142 | static const struct kernel_symbol *lookup_symbol(const char *name, | ||
143 | const struct kernel_symbol *start, | ||
144 | const struct kernel_symbol *stop) | ||
145 | { | ||
146 | const struct kernel_symbol *ks = start; | ||
147 | for (; ks < stop; ks++) | ||
148 | if (strcmp(ks->name, name) == 0) | ||
149 | return ks; | ||
150 | return NULL; | ||
151 | } | ||
152 | |||
138 | /* Find a symbol, return value, crc and module which owns it */ | 153 | /* Find a symbol, return value, crc and module which owns it */ |
139 | static unsigned long __find_symbol(const char *name, | 154 | static unsigned long __find_symbol(const char *name, |
140 | struct module **owner, | 155 | struct module **owner, |
@@ -142,40 +157,75 @@ static unsigned long __find_symbol(const char *name, | |||
142 | int gplok) | 157 | int gplok) |
143 | { | 158 | { |
144 | struct module *mod; | 159 | struct module *mod; |
145 | unsigned int i; | 160 | const struct kernel_symbol *ks; |
146 | 161 | ||
147 | /* Core kernel first. */ | 162 | /* Core kernel first. */ |
148 | *owner = NULL; | 163 | *owner = NULL; |
149 | for (i = 0; __start___ksymtab+i < __stop___ksymtab; i++) { | 164 | ks = lookup_symbol(name, __start___ksymtab, __stop___ksymtab); |
150 | if (strcmp(__start___ksymtab[i].name, name) == 0) { | 165 | if (ks) { |
151 | *crc = symversion(__start___kcrctab, i); | 166 | *crc = symversion(__start___kcrctab, (ks - __start___ksymtab)); |
152 | return __start___ksymtab[i].value; | 167 | return ks->value; |
153 | } | ||
154 | } | 168 | } |
155 | if (gplok) { | 169 | if (gplok) { |
156 | for (i = 0; __start___ksymtab_gpl+i<__stop___ksymtab_gpl; i++) | 170 | ks = lookup_symbol(name, __start___ksymtab_gpl, |
157 | if (strcmp(__start___ksymtab_gpl[i].name, name) == 0) { | 171 | __stop___ksymtab_gpl); |
158 | *crc = symversion(__start___kcrctab_gpl, i); | 172 | if (ks) { |
159 | return __start___ksymtab_gpl[i].value; | 173 | *crc = symversion(__start___kcrctab_gpl, |
160 | } | 174 | (ks - __start___ksymtab_gpl)); |
175 | return ks->value; | ||
176 | } | ||
177 | } | ||
178 | ks = lookup_symbol(name, __start___ksymtab_gpl_future, | ||
179 | __stop___ksymtab_gpl_future); | ||
180 | if (ks) { | ||
181 | if (!gplok) { | ||
182 | printk(KERN_WARNING "Symbol %s is being used " | ||
183 | "by a non-GPL module, which will not " | ||
184 | "be allowed in the future\n", name); | ||
185 | printk(KERN_WARNING "Please see the file " | ||
186 | "Documentation/feature-removal-schedule.txt " | ||
187 | "in the kernel source tree for more " | ||
188 | "details.\n"); | ||
189 | } | ||
190 | *crc = symversion(__start___kcrctab_gpl_future, | ||
191 | (ks - __start___ksymtab_gpl_future)); | ||
192 | return ks->value; | ||
161 | } | 193 | } |
162 | 194 | ||
163 | /* Now try modules. */ | 195 | /* Now try modules. */ |
164 | list_for_each_entry(mod, &modules, list) { | 196 | list_for_each_entry(mod, &modules, list) { |
165 | *owner = mod; | 197 | *owner = mod; |
166 | for (i = 0; i < mod->num_syms; i++) | 198 | ks = lookup_symbol(name, mod->syms, mod->syms + mod->num_syms); |
167 | if (strcmp(mod->syms[i].name, name) == 0) { | 199 | if (ks) { |
168 | *crc = symversion(mod->crcs, i); | 200 | *crc = symversion(mod->crcs, (ks - mod->syms)); |
169 | return mod->syms[i].value; | 201 | return ks->value; |
170 | } | 202 | } |
171 | 203 | ||
172 | if (gplok) { | 204 | if (gplok) { |
173 | for (i = 0; i < mod->num_gpl_syms; i++) { | 205 | ks = lookup_symbol(name, mod->gpl_syms, |
174 | if (strcmp(mod->gpl_syms[i].name, name) == 0) { | 206 | mod->gpl_syms + mod->num_gpl_syms); |
175 | *crc = symversion(mod->gpl_crcs, i); | 207 | if (ks) { |
176 | return mod->gpl_syms[i].value; | 208 | *crc = symversion(mod->gpl_crcs, |
177 | } | 209 | (ks - mod->gpl_syms)); |
210 | return ks->value; | ||
211 | } | ||
212 | } | ||
213 | ks = lookup_symbol(name, mod->gpl_future_syms, | ||
214 | (mod->gpl_future_syms + | ||
215 | mod->num_gpl_future_syms)); | ||
216 | if (ks) { | ||
217 | if (!gplok) { | ||
218 | printk(KERN_WARNING "Symbol %s is being used " | ||
219 | "by a non-GPL module, which will not " | ||
220 | "be allowed in the future\n", name); | ||
221 | printk(KERN_WARNING "Please see the file " | ||
222 | "Documentation/feature-removal-schedule.txt " | ||
223 | "in the kernel source tree for more " | ||
224 | "details.\n"); | ||
178 | } | 225 | } |
226 | *crc = symversion(mod->gpl_future_crcs, | ||
227 | (ks - mod->gpl_future_syms)); | ||
228 | return ks->value; | ||
179 | } | 229 | } |
180 | } | 230 | } |
181 | DEBUGP("Failed to find symbol %s\n", name); | 231 | DEBUGP("Failed to find symbol %s\n", name); |
@@ -379,7 +429,6 @@ static inline void percpu_modcopy(void *pcpudst, const void *src, | |||
379 | } | 429 | } |
380 | #endif /* CONFIG_SMP */ | 430 | #endif /* CONFIG_SMP */ |
381 | 431 | ||
382 | #ifdef CONFIG_MODULE_UNLOAD | ||
383 | #define MODINFO_ATTR(field) \ | 432 | #define MODINFO_ATTR(field) \ |
384 | static void setup_modinfo_##field(struct module *mod, const char *s) \ | 433 | static void setup_modinfo_##field(struct module *mod, const char *s) \ |
385 | { \ | 434 | { \ |
@@ -411,12 +460,7 @@ static struct module_attribute modinfo_##field = { \ | |||
411 | MODINFO_ATTR(version); | 460 | MODINFO_ATTR(version); |
412 | MODINFO_ATTR(srcversion); | 461 | MODINFO_ATTR(srcversion); |
413 | 462 | ||
414 | static struct module_attribute *modinfo_attrs[] = { | 463 | #ifdef CONFIG_MODULE_UNLOAD |
415 | &modinfo_version, | ||
416 | &modinfo_srcversion, | ||
417 | NULL, | ||
418 | }; | ||
419 | |||
420 | /* Init the unload section of the module. */ | 464 | /* Init the unload section of the module. */ |
421 | static void module_unload_init(struct module *mod) | 465 | static void module_unload_init(struct module *mod) |
422 | { | 466 | { |
@@ -731,6 +775,15 @@ static inline void module_unload_init(struct module *mod) | |||
731 | } | 775 | } |
732 | #endif /* CONFIG_MODULE_UNLOAD */ | 776 | #endif /* CONFIG_MODULE_UNLOAD */ |
733 | 777 | ||
778 | static struct module_attribute *modinfo_attrs[] = { | ||
779 | &modinfo_version, | ||
780 | &modinfo_srcversion, | ||
781 | #ifdef CONFIG_MODULE_UNLOAD | ||
782 | &refcnt, | ||
783 | #endif | ||
784 | NULL, | ||
785 | }; | ||
786 | |||
734 | #ifdef CONFIG_OBSOLETE_MODPARM | 787 | #ifdef CONFIG_OBSOLETE_MODPARM |
735 | /* Bounds checking done below */ | 788 | /* Bounds checking done below */ |
736 | static int obsparm_copy_string(const char *val, struct kernel_param *kp) | 789 | static int obsparm_copy_string(const char *val, struct kernel_param *kp) |
@@ -1056,37 +1109,28 @@ static inline void remove_sect_attrs(struct module *mod) | |||
1056 | } | 1109 | } |
1057 | #endif /* CONFIG_KALLSYMS */ | 1110 | #endif /* CONFIG_KALLSYMS */ |
1058 | 1111 | ||
1059 | |||
1060 | #ifdef CONFIG_MODULE_UNLOAD | ||
1061 | static inline int module_add_refcnt_attr(struct module *mod) | ||
1062 | { | ||
1063 | return sysfs_create_file(&mod->mkobj.kobj, &refcnt.attr); | ||
1064 | } | ||
1065 | static void module_remove_refcnt_attr(struct module *mod) | ||
1066 | { | ||
1067 | return sysfs_remove_file(&mod->mkobj.kobj, &refcnt.attr); | ||
1068 | } | ||
1069 | #else | ||
1070 | static inline int module_add_refcnt_attr(struct module *mod) | ||
1071 | { | ||
1072 | return 0; | ||
1073 | } | ||
1074 | static void module_remove_refcnt_attr(struct module *mod) | ||
1075 | { | ||
1076 | } | ||
1077 | #endif | ||
1078 | |||
1079 | #ifdef CONFIG_MODULE_UNLOAD | ||
1080 | static int module_add_modinfo_attrs(struct module *mod) | 1112 | static int module_add_modinfo_attrs(struct module *mod) |
1081 | { | 1113 | { |
1082 | struct module_attribute *attr; | 1114 | struct module_attribute *attr; |
1115 | struct module_attribute *temp_attr; | ||
1083 | int error = 0; | 1116 | int error = 0; |
1084 | int i; | 1117 | int i; |
1085 | 1118 | ||
1119 | mod->modinfo_attrs = kzalloc((sizeof(struct module_attribute) * | ||
1120 | (ARRAY_SIZE(modinfo_attrs) + 1)), | ||
1121 | GFP_KERNEL); | ||
1122 | if (!mod->modinfo_attrs) | ||
1123 | return -ENOMEM; | ||
1124 | |||
1125 | temp_attr = mod->modinfo_attrs; | ||
1086 | for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) { | 1126 | for (i = 0; (attr = modinfo_attrs[i]) && !error; i++) { |
1087 | if (!attr->test || | 1127 | if (!attr->test || |
1088 | (attr->test && attr->test(mod))) | 1128 | (attr->test && attr->test(mod))) { |
1089 | error = sysfs_create_file(&mod->mkobj.kobj,&attr->attr); | 1129 | memcpy(temp_attr, attr, sizeof(*temp_attr)); |
1130 | temp_attr->attr.owner = mod; | ||
1131 | error = sysfs_create_file(&mod->mkobj.kobj,&temp_attr->attr); | ||
1132 | ++temp_attr; | ||
1133 | } | ||
1090 | } | 1134 | } |
1091 | return error; | 1135 | return error; |
1092 | } | 1136 | } |
@@ -1096,12 +1140,16 @@ static void module_remove_modinfo_attrs(struct module *mod) | |||
1096 | struct module_attribute *attr; | 1140 | struct module_attribute *attr; |
1097 | int i; | 1141 | int i; |
1098 | 1142 | ||
1099 | for (i = 0; (attr = modinfo_attrs[i]); i++) { | 1143 | for (i = 0; (attr = &mod->modinfo_attrs[i]); i++) { |
1144 | /* pick a field to test for end of list */ | ||
1145 | if (!attr->attr.name) | ||
1146 | break; | ||
1100 | sysfs_remove_file(&mod->mkobj.kobj,&attr->attr); | 1147 | sysfs_remove_file(&mod->mkobj.kobj,&attr->attr); |
1101 | attr->free(mod); | 1148 | if (attr->free) |
1149 | attr->free(mod); | ||
1102 | } | 1150 | } |
1151 | kfree(mod->modinfo_attrs); | ||
1103 | } | 1152 | } |
1104 | #endif | ||
1105 | 1153 | ||
1106 | static int mod_sysfs_setup(struct module *mod, | 1154 | static int mod_sysfs_setup(struct module *mod, |
1107 | struct kernel_param *kparam, | 1155 | struct kernel_param *kparam, |
@@ -1119,19 +1167,13 @@ static int mod_sysfs_setup(struct module *mod, | |||
1119 | if (err) | 1167 | if (err) |
1120 | goto out; | 1168 | goto out; |
1121 | 1169 | ||
1122 | err = module_add_refcnt_attr(mod); | ||
1123 | if (err) | ||
1124 | goto out_unreg; | ||
1125 | |||
1126 | err = module_param_sysfs_setup(mod, kparam, num_params); | 1170 | err = module_param_sysfs_setup(mod, kparam, num_params); |
1127 | if (err) | 1171 | if (err) |
1128 | goto out_unreg; | 1172 | goto out_unreg; |
1129 | 1173 | ||
1130 | #ifdef CONFIG_MODULE_UNLOAD | ||
1131 | err = module_add_modinfo_attrs(mod); | 1174 | err = module_add_modinfo_attrs(mod); |
1132 | if (err) | 1175 | if (err) |
1133 | goto out_unreg; | 1176 | goto out_unreg; |
1134 | #endif | ||
1135 | 1177 | ||
1136 | return 0; | 1178 | return 0; |
1137 | 1179 | ||
@@ -1143,10 +1185,7 @@ out: | |||
1143 | 1185 | ||
1144 | static void mod_kobject_remove(struct module *mod) | 1186 | static void mod_kobject_remove(struct module *mod) |
1145 | { | 1187 | { |
1146 | #ifdef CONFIG_MODULE_UNLOAD | ||
1147 | module_remove_modinfo_attrs(mod); | 1188 | module_remove_modinfo_attrs(mod); |
1148 | #endif | ||
1149 | module_remove_refcnt_attr(mod); | ||
1150 | module_param_sysfs_remove(mod); | 1189 | module_param_sysfs_remove(mod); |
1151 | 1190 | ||
1152 | kobject_unregister(&mod->mkobj.kobj); | 1191 | kobject_unregister(&mod->mkobj.kobj); |
@@ -1424,7 +1463,6 @@ static char *get_modinfo(Elf_Shdr *sechdrs, | |||
1424 | return NULL; | 1463 | return NULL; |
1425 | } | 1464 | } |
1426 | 1465 | ||
1427 | #ifdef CONFIG_MODULE_UNLOAD | ||
1428 | static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, | 1466 | static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, |
1429 | unsigned int infoindex) | 1467 | unsigned int infoindex) |
1430 | { | 1468 | { |
@@ -1439,23 +1477,17 @@ static void setup_modinfo(struct module *mod, Elf_Shdr *sechdrs, | |||
1439 | attr->attr.name)); | 1477 | attr->attr.name)); |
1440 | } | 1478 | } |
1441 | } | 1479 | } |
1442 | #endif | ||
1443 | 1480 | ||
1444 | #ifdef CONFIG_KALLSYMS | 1481 | #ifdef CONFIG_KALLSYMS |
1445 | int is_exported(const char *name, const struct module *mod) | 1482 | int is_exported(const char *name, const struct module *mod) |
1446 | { | 1483 | { |
1447 | unsigned int i; | 1484 | if (!mod && lookup_symbol(name, __start___ksymtab, __stop___ksymtab)) |
1448 | 1485 | return 1; | |
1449 | if (!mod) { | 1486 | else |
1450 | for (i = 0; __start___ksymtab+i < __stop___ksymtab; i++) | 1487 | if (lookup_symbol(name, mod->syms, mod->syms + mod->num_syms)) |
1451 | if (strcmp(__start___ksymtab[i].name, name) == 0) | ||
1452 | return 1; | ||
1453 | return 0; | ||
1454 | } | ||
1455 | for (i = 0; i < mod->num_syms; i++) | ||
1456 | if (strcmp(mod->syms[i].name, name) == 0) | ||
1457 | return 1; | 1488 | return 1; |
1458 | return 0; | 1489 | else |
1490 | return 0; | ||
1459 | } | 1491 | } |
1460 | 1492 | ||
1461 | /* As per nm */ | 1493 | /* As per nm */ |
@@ -1537,7 +1569,8 @@ static struct module *load_module(void __user *umod, | |||
1537 | char *secstrings, *args, *modmagic, *strtab = NULL; | 1569 | char *secstrings, *args, *modmagic, *strtab = NULL; |
1538 | unsigned int i, symindex = 0, strindex = 0, setupindex, exindex, | 1570 | unsigned int i, symindex = 0, strindex = 0, setupindex, exindex, |
1539 | exportindex, modindex, obsparmindex, infoindex, gplindex, | 1571 | exportindex, modindex, obsparmindex, infoindex, gplindex, |
1540 | crcindex, gplcrcindex, versindex, pcpuindex; | 1572 | crcindex, gplcrcindex, versindex, pcpuindex, gplfutureindex, |
1573 | gplfuturecrcindex; | ||
1541 | long arglen; | 1574 | long arglen; |
1542 | struct module *mod; | 1575 | struct module *mod; |
1543 | long err = 0; | 1576 | long err = 0; |
@@ -1618,8 +1651,10 @@ static struct module *load_module(void __user *umod, | |||
1618 | /* Optional sections */ | 1651 | /* Optional sections */ |
1619 | exportindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab"); | 1652 | exportindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab"); |
1620 | gplindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab_gpl"); | 1653 | gplindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab_gpl"); |
1654 | gplfutureindex = find_sec(hdr, sechdrs, secstrings, "__ksymtab_gpl_future"); | ||
1621 | crcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab"); | 1655 | crcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab"); |
1622 | gplcrcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab_gpl"); | 1656 | gplcrcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab_gpl"); |
1657 | gplfuturecrcindex = find_sec(hdr, sechdrs, secstrings, "__kcrctab_gpl_future"); | ||
1623 | setupindex = find_sec(hdr, sechdrs, secstrings, "__param"); | 1658 | setupindex = find_sec(hdr, sechdrs, secstrings, "__param"); |
1624 | exindex = find_sec(hdr, sechdrs, secstrings, "__ex_table"); | 1659 | exindex = find_sec(hdr, sechdrs, secstrings, "__ex_table"); |
1625 | obsparmindex = find_sec(hdr, sechdrs, secstrings, "__obsparm"); | 1660 | obsparmindex = find_sec(hdr, sechdrs, secstrings, "__obsparm"); |
@@ -1755,10 +1790,8 @@ static struct module *load_module(void __user *umod, | |||
1755 | if (strcmp(mod->name, "driverloader") == 0) | 1790 | if (strcmp(mod->name, "driverloader") == 0) |
1756 | add_taint(TAINT_PROPRIETARY_MODULE); | 1791 | add_taint(TAINT_PROPRIETARY_MODULE); |
1757 | 1792 | ||
1758 | #ifdef CONFIG_MODULE_UNLOAD | ||
1759 | /* Set up MODINFO_ATTR fields */ | 1793 | /* Set up MODINFO_ATTR fields */ |
1760 | setup_modinfo(mod, sechdrs, infoindex); | 1794 | setup_modinfo(mod, sechdrs, infoindex); |
1761 | #endif | ||
1762 | 1795 | ||
1763 | /* Fix up syms, so that st_value is a pointer to location. */ | 1796 | /* Fix up syms, so that st_value is a pointer to location. */ |
1764 | err = simplify_symbols(sechdrs, symindex, strtab, versindex, pcpuindex, | 1797 | err = simplify_symbols(sechdrs, symindex, strtab, versindex, pcpuindex, |
@@ -1775,10 +1808,16 @@ static struct module *load_module(void __user *umod, | |||
1775 | mod->gpl_syms = (void *)sechdrs[gplindex].sh_addr; | 1808 | mod->gpl_syms = (void *)sechdrs[gplindex].sh_addr; |
1776 | if (gplcrcindex) | 1809 | if (gplcrcindex) |
1777 | mod->gpl_crcs = (void *)sechdrs[gplcrcindex].sh_addr; | 1810 | mod->gpl_crcs = (void *)sechdrs[gplcrcindex].sh_addr; |
1811 | mod->num_gpl_future_syms = sechdrs[gplfutureindex].sh_size / | ||
1812 | sizeof(*mod->gpl_future_syms); | ||
1813 | mod->gpl_future_syms = (void *)sechdrs[gplfutureindex].sh_addr; | ||
1814 | if (gplfuturecrcindex) | ||
1815 | mod->gpl_future_crcs = (void *)sechdrs[gplfuturecrcindex].sh_addr; | ||
1778 | 1816 | ||
1779 | #ifdef CONFIG_MODVERSIONS | 1817 | #ifdef CONFIG_MODVERSIONS |
1780 | if ((mod->num_syms && !crcindex) || | 1818 | if ((mod->num_syms && !crcindex) || |
1781 | (mod->num_gpl_syms && !gplcrcindex)) { | 1819 | (mod->num_gpl_syms && !gplcrcindex) || |
1820 | (mod->num_gpl_future_syms && !gplfuturecrcindex)) { | ||
1782 | printk(KERN_WARNING "%s: No versions for exported symbols." | 1821 | printk(KERN_WARNING "%s: No versions for exported symbols." |
1783 | " Tainting kernel.\n", mod->name); | 1822 | " Tainting kernel.\n", mod->name); |
1784 | add_taint(TAINT_FORCED_MODULE); | 1823 | add_taint(TAINT_FORCED_MODULE); |
diff --git a/kernel/params.c b/kernel/params.c index c76ad25e6a21..a29150582310 100644 --- a/kernel/params.c +++ b/kernel/params.c | |||
@@ -638,13 +638,8 @@ static ssize_t module_attr_show(struct kobject *kobj, | |||
638 | if (!attribute->show) | 638 | if (!attribute->show) |
639 | return -EIO; | 639 | return -EIO; |
640 | 640 | ||
641 | if (!try_module_get(mk->mod)) | ||
642 | return -ENODEV; | ||
643 | |||
644 | ret = attribute->show(attribute, mk->mod, buf); | 641 | ret = attribute->show(attribute, mk->mod, buf); |
645 | 642 | ||
646 | module_put(mk->mod); | ||
647 | |||
648 | return ret; | 643 | return ret; |
649 | } | 644 | } |
650 | 645 | ||
@@ -662,13 +657,8 @@ static ssize_t module_attr_store(struct kobject *kobj, | |||
662 | if (!attribute->store) | 657 | if (!attribute->store) |
663 | return -EIO; | 658 | return -EIO; |
664 | 659 | ||
665 | if (!try_module_get(mk->mod)) | ||
666 | return -ENODEV; | ||
667 | |||
668 | ret = attribute->store(attribute, mk->mod, buf, len); | 660 | ret = attribute->store(attribute, mk->mod, buf, len); |
669 | 661 | ||
670 | module_put(mk->mod); | ||
671 | |||
672 | return ret; | 662 | return ret; |
673 | } | 663 | } |
674 | 664 | ||
diff --git a/kernel/posix-timers.c b/kernel/posix-timers.c index 216f574b5ffb..fa895fc2ecf5 100644 --- a/kernel/posix-timers.c +++ b/kernel/posix-timers.c | |||
@@ -353,6 +353,7 @@ static int posix_timer_fn(void *data) | |||
353 | hrtimer_forward(&timr->it.real.timer, | 353 | hrtimer_forward(&timr->it.real.timer, |
354 | timr->it.real.interval); | 354 | timr->it.real.interval); |
355 | ret = HRTIMER_RESTART; | 355 | ret = HRTIMER_RESTART; |
356 | ++timr->it_requeue_pending; | ||
356 | } | 357 | } |
357 | } | 358 | } |
358 | 359 | ||
diff --git a/kernel/rcupdate.c b/kernel/rcupdate.c index 8cf15a569fcd..fedf5e369755 100644 --- a/kernel/rcupdate.c +++ b/kernel/rcupdate.c | |||
@@ -609,7 +609,7 @@ module_param(qlowmark, int, 0); | |||
609 | module_param(rsinterval, int, 0); | 609 | module_param(rsinterval, int, 0); |
610 | #endif | 610 | #endif |
611 | EXPORT_SYMBOL_GPL(rcu_batches_completed); | 611 | EXPORT_SYMBOL_GPL(rcu_batches_completed); |
612 | EXPORT_SYMBOL(call_rcu); /* WARNING: GPL-only in April 2006. */ | 612 | EXPORT_SYMBOL_GPL_FUTURE(call_rcu); /* WARNING: GPL-only in April 2006. */ |
613 | EXPORT_SYMBOL(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ | 613 | EXPORT_SYMBOL_GPL_FUTURE(call_rcu_bh); /* WARNING: GPL-only in April 2006. */ |
614 | EXPORT_SYMBOL_GPL(synchronize_rcu); | 614 | EXPORT_SYMBOL_GPL(synchronize_rcu); |
615 | EXPORT_SYMBOL(synchronize_kernel); /* WARNING: GPL-only in April 2006. */ | 615 | EXPORT_SYMBOL_GPL_FUTURE(synchronize_kernel); /* WARNING: GPL-only in April 2006. */ |
diff --git a/kernel/timer.c b/kernel/timer.c index bf7c4193b936..2410c18dbeb1 100644 --- a/kernel/timer.c +++ b/kernel/timer.c | |||
@@ -1354,8 +1354,8 @@ void __init init_timers(void) | |||
1354 | 1354 | ||
1355 | #ifdef CONFIG_TIME_INTERPOLATION | 1355 | #ifdef CONFIG_TIME_INTERPOLATION |
1356 | 1356 | ||
1357 | struct time_interpolator *time_interpolator; | 1357 | struct time_interpolator *time_interpolator __read_mostly; |
1358 | static struct time_interpolator *time_interpolator_list; | 1358 | static struct time_interpolator *time_interpolator_list __read_mostly; |
1359 | static DEFINE_SPINLOCK(time_interpolator_lock); | 1359 | static DEFINE_SPINLOCK(time_interpolator_lock); |
1360 | 1360 | ||
1361 | static inline u64 time_interpolator_get_cycles(unsigned int src) | 1361 | static inline u64 time_interpolator_get_cycles(unsigned int src) |