aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 18:05:42 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2013-03-08 18:05:42 -0500
commit59d8e5eb2bd5593d8220db0e25206cdfc42e83ea (patch)
tree5a11524581ff040f2c335fc6a318ff54f100552c
parentc4c5ff09872751eeb412e3e1af484955529426a1 (diff)
parentc3d6b628395fe6ec3442a83ddf02334c54867d43 (diff)
Merge branch 'akpm' (fixes from Andrew)
Merge misc fixes from Andrew Morton. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: alpha: boot: fix build breakage introduced by system.h disintegration memcg: initialize kmem-cache destroying work earlier Randy has moved ksm: fix m68k build: only NUMA needs pfn_to_nid dmi_scan: fix missing check for _DMI_ signature in smbios_present() Revert parts of "hlist: drop the node parameter from iterators" idr: remove WARN_ON_ONCE() on negative IDs mm/mempolicy.c: fix sp_node_init() argument ordering mm/mempolicy.c: fix wrong sp_node insertion ipc: don't allocate a copy larger than max ipc: fix potential oops when src msg > 4k w/ MSG_COPY
-rw-r--r--CREDITS6
-rw-r--r--Documentation/SubmittingPatches3
-rw-r--r--Documentation/printk-formats.txt2
-rw-r--r--arch/alpha/boot/head.S1
-rw-r--r--drivers/firmware/dmi_scan.c5
-rw-r--r--ipc/msg.c6
-rw-r--r--ipc/msgutil.c3
-rw-r--r--kernel/smpboot.c2
-rw-r--r--lib/idr.c16
-rw-r--r--mm/ksm.c2
-rw-r--r--mm/memcontrol.c8
-rw-r--r--mm/mempolicy.c4
-rw-r--r--net/9p/trans_virtio.c2
13 files changed, 26 insertions, 34 deletions
diff --git a/CREDITS b/CREDITS
index 948e0fb9a70e..78163cb3eb6a 100644
--- a/CREDITS
+++ b/CREDITS
@@ -953,11 +953,11 @@ S: Blacksburg, Virginia 24061
953S: USA 953S: USA
954 954
955N: Randy Dunlap 955N: Randy Dunlap
956E: rdunlap@xenotime.net 956E: rdunlap@infradead.org
957W: http://www.xenotime.net/linux/linux.html 957W: http://www.infradead.org/~rdunlap/
958W: http://www.linux-usb.org
959D: Linux-USB subsystem, USB core/UHCI/printer/storage drivers 958D: Linux-USB subsystem, USB core/UHCI/printer/storage drivers
960D: x86 SMP, ACPI, bootflag hacking 959D: x86 SMP, ACPI, bootflag hacking
960D: documentation, builds
961S: (ask for current address) 961S: (ask for current address)
962S: USA 962S: USA
963 963
diff --git a/Documentation/SubmittingPatches b/Documentation/SubmittingPatches
index c379a2a6949f..aa0c1e63f050 100644
--- a/Documentation/SubmittingPatches
+++ b/Documentation/SubmittingPatches
@@ -60,8 +60,7 @@ own source tree. For example:
60"dontdiff" is a list of files which are generated by the kernel during 60"dontdiff" is a list of files which are generated by the kernel during
61the build process, and should be ignored in any diff(1)-generated 61the build process, and should be ignored in any diff(1)-generated
62patch. The "dontdiff" file is included in the kernel tree in 62patch. The "dontdiff" file is included in the kernel tree in
632.6.12 and later. For earlier kernel versions, you can get it 632.6.12 and later.
64from <http://www.xenotime.net/linux/doc/dontdiff>.
65 64
66Make sure your patch does not include any extra files which do not 65Make sure your patch does not include any extra files which do not
67belong in a patch submission. Make sure to review your patch -after- 66belong in a patch submission. Make sure to review your patch -after-
diff --git a/Documentation/printk-formats.txt b/Documentation/printk-formats.txt
index e8a6aa473bab..6e953564de03 100644
--- a/Documentation/printk-formats.txt
+++ b/Documentation/printk-formats.txt
@@ -170,5 +170,5 @@ Reminder: sizeof() result is of type size_t.
170Thank you for your cooperation and attention. 170Thank you for your cooperation and attention.
171 171
172 172
173By Randy Dunlap <rdunlap@xenotime.net> and 173By Randy Dunlap <rdunlap@infradead.org> and
174Andrew Murray <amurray@mpc-data.co.uk> 174Andrew Murray <amurray@mpc-data.co.uk>
diff --git a/arch/alpha/boot/head.S b/arch/alpha/boot/head.S
index b06812bcac83..8efb26686d47 100644
--- a/arch/alpha/boot/head.S
+++ b/arch/alpha/boot/head.S
@@ -4,6 +4,7 @@
4 * initial bootloader stuff.. 4 * initial bootloader stuff..
5 */ 5 */
6 6
7#include <asm/pal.h>
7 8
8 .set noreorder 9 .set noreorder
9 .globl __start 10 .globl __start
diff --git a/drivers/firmware/dmi_scan.c b/drivers/firmware/dmi_scan.c
index 982f1f5f5742..4cd392dbf115 100644
--- a/drivers/firmware/dmi_scan.c
+++ b/drivers/firmware/dmi_scan.c
@@ -442,7 +442,6 @@ static int __init dmi_present(const char __iomem *p)
442static int __init smbios_present(const char __iomem *p) 442static int __init smbios_present(const char __iomem *p)
443{ 443{
444 u8 buf[32]; 444 u8 buf[32];
445 int offset = 0;
446 445
447 memcpy_fromio(buf, p, 32); 446 memcpy_fromio(buf, p, 32);
448 if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) { 447 if ((buf[5] < 32) && dmi_checksum(buf, buf[5])) {
@@ -461,9 +460,9 @@ static int __init smbios_present(const char __iomem *p)
461 dmi_ver = 0x0206; 460 dmi_ver = 0x0206;
462 break; 461 break;
463 } 462 }
464 offset = 16; 463 return memcmp(p + 16, "_DMI_", 5) || dmi_present(p + 16);
465 } 464 }
466 return dmi_present(buf + offset); 465 return 1;
467} 466}
468 467
469void __init dmi_scan_machine(void) 468void __init dmi_scan_machine(void)
diff --git a/ipc/msg.c b/ipc/msg.c
index 950572f9d796..31cd1bf6af27 100644
--- a/ipc/msg.c
+++ b/ipc/msg.c
@@ -820,15 +820,17 @@ long do_msgrcv(int msqid, void __user *buf, size_t bufsz, long msgtyp,
820 struct msg_msg *copy = NULL; 820 struct msg_msg *copy = NULL;
821 unsigned long copy_number = 0; 821 unsigned long copy_number = 0;
822 822
823 ns = current->nsproxy->ipc_ns;
824
823 if (msqid < 0 || (long) bufsz < 0) 825 if (msqid < 0 || (long) bufsz < 0)
824 return -EINVAL; 826 return -EINVAL;
825 if (msgflg & MSG_COPY) { 827 if (msgflg & MSG_COPY) {
826 copy = prepare_copy(buf, bufsz, msgflg, &msgtyp, &copy_number); 828 copy = prepare_copy(buf, min_t(size_t, bufsz, ns->msg_ctlmax),
829 msgflg, &msgtyp, &copy_number);
827 if (IS_ERR(copy)) 830 if (IS_ERR(copy))
828 return PTR_ERR(copy); 831 return PTR_ERR(copy);
829 } 832 }
830 mode = convert_mode(&msgtyp, msgflg); 833 mode = convert_mode(&msgtyp, msgflg);
831 ns = current->nsproxy->ipc_ns;
832 834
833 msq = msg_lock_check(ns, msqid); 835 msq = msg_lock_check(ns, msqid);
834 if (IS_ERR(msq)) { 836 if (IS_ERR(msq)) {
diff --git a/ipc/msgutil.c b/ipc/msgutil.c
index ebfcbfa8b7f2..5df8e4bf1db0 100644
--- a/ipc/msgutil.c
+++ b/ipc/msgutil.c
@@ -117,9 +117,6 @@ struct msg_msg *copy_msg(struct msg_msg *src, struct msg_msg *dst)
117 if (alen > DATALEN_MSG) 117 if (alen > DATALEN_MSG)
118 alen = DATALEN_MSG; 118 alen = DATALEN_MSG;
119 119
120 dst->next = NULL;
121 dst->security = NULL;
122
123 memcpy(dst + 1, src + 1, alen); 120 memcpy(dst + 1, src + 1, alen);
124 121
125 len -= alen; 122 len -= alen;
diff --git a/kernel/smpboot.c b/kernel/smpboot.c
index 25d3d8b6e4e1..8eaed9aa9cf0 100644
--- a/kernel/smpboot.c
+++ b/kernel/smpboot.c
@@ -131,7 +131,7 @@ static int smpboot_thread_fn(void *data)
131 continue; 131 continue;
132 } 132 }
133 133
134 //BUG_ON(td->cpu != smp_processor_id()); 134 BUG_ON(td->cpu != smp_processor_id());
135 135
136 /* Check for state change setup */ 136 /* Check for state change setup */
137 switch (td->status) { 137 switch (td->status) {
diff --git a/lib/idr.c b/lib/idr.c
index 73f4d53c02f3..00739aaf95a2 100644
--- a/lib/idr.c
+++ b/lib/idr.c
@@ -569,8 +569,7 @@ void idr_remove(struct idr *idp, int id)
569 struct idr_layer *p; 569 struct idr_layer *p;
570 struct idr_layer *to_free; 570 struct idr_layer *to_free;
571 571
572 /* see comment in idr_find_slowpath() */ 572 if (id < 0)
573 if (WARN_ON_ONCE(id < 0))
574 return; 573 return;
575 574
576 sub_remove(idp, (idp->layers - 1) * IDR_BITS, id); 575 sub_remove(idp, (idp->layers - 1) * IDR_BITS, id);
@@ -667,15 +666,7 @@ void *idr_find_slowpath(struct idr *idp, int id)
667 int n; 666 int n;
668 struct idr_layer *p; 667 struct idr_layer *p;
669 668
670 /* 669 if (id < 0)
671 * If @id is negative, idr_find() used to ignore the sign bit and
672 * performed lookup with the rest of bits, which is weird and can
673 * lead to very obscure bugs. We're now returning NULL for all
674 * negative IDs but just in case somebody was depending on the sign
675 * bit being ignored, let's trigger WARN_ON_ONCE() so that they can
676 * be detected and fixed. WARN_ON_ONCE() can later be removed.
677 */
678 if (WARN_ON_ONCE(id < 0))
679 return NULL; 670 return NULL;
680 671
681 p = rcu_dereference_raw(idp->top); 672 p = rcu_dereference_raw(idp->top);
@@ -824,8 +815,7 @@ void *idr_replace(struct idr *idp, void *ptr, int id)
824 int n; 815 int n;
825 struct idr_layer *p, *old_p; 816 struct idr_layer *p, *old_p;
826 817
827 /* see comment in idr_find_slowpath() */ 818 if (id < 0)
828 if (WARN_ON_ONCE(id < 0))
829 return ERR_PTR(-EINVAL); 819 return ERR_PTR(-EINVAL);
830 820
831 p = idp->top; 821 p = idp->top;
diff --git a/mm/ksm.c b/mm/ksm.c
index 85bfd4c16346..b6afe0c440d8 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -489,7 +489,7 @@ out: page = NULL;
489 */ 489 */
490static inline int get_kpfn_nid(unsigned long kpfn) 490static inline int get_kpfn_nid(unsigned long kpfn)
491{ 491{
492 return ksm_merge_across_nodes ? 0 : pfn_to_nid(kpfn); 492 return ksm_merge_across_nodes ? 0 : NUMA(pfn_to_nid(kpfn));
493} 493}
494 494
495static void remove_node_from_stable_tree(struct stable_node *stable_node) 495static void remove_node_from_stable_tree(struct stable_node *stable_node)
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 53b8201b31eb..2b552224f5cf 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -3012,6 +3012,8 @@ void memcg_update_array_size(int num)
3012 memcg_limited_groups_array_size = memcg_caches_array_size(num); 3012 memcg_limited_groups_array_size = memcg_caches_array_size(num);
3013} 3013}
3014 3014
3015static void kmem_cache_destroy_work_func(struct work_struct *w);
3016
3015int memcg_update_cache_size(struct kmem_cache *s, int num_groups) 3017int memcg_update_cache_size(struct kmem_cache *s, int num_groups)
3016{ 3018{
3017 struct memcg_cache_params *cur_params = s->memcg_params; 3019 struct memcg_cache_params *cur_params = s->memcg_params;
@@ -3031,6 +3033,8 @@ int memcg_update_cache_size(struct kmem_cache *s, int num_groups)
3031 return -ENOMEM; 3033 return -ENOMEM;
3032 } 3034 }
3033 3035
3036 INIT_WORK(&s->memcg_params->destroy,
3037 kmem_cache_destroy_work_func);
3034 s->memcg_params->is_root_cache = true; 3038 s->memcg_params->is_root_cache = true;
3035 3039
3036 /* 3040 /*
@@ -3078,6 +3082,8 @@ int memcg_register_cache(struct mem_cgroup *memcg, struct kmem_cache *s,
3078 if (!s->memcg_params) 3082 if (!s->memcg_params)
3079 return -ENOMEM; 3083 return -ENOMEM;
3080 3084
3085 INIT_WORK(&s->memcg_params->destroy,
3086 kmem_cache_destroy_work_func);
3081 if (memcg) { 3087 if (memcg) {
3082 s->memcg_params->memcg = memcg; 3088 s->memcg_params->memcg = memcg;
3083 s->memcg_params->root_cache = root_cache; 3089 s->memcg_params->root_cache = root_cache;
@@ -3358,8 +3364,6 @@ static void mem_cgroup_destroy_all_caches(struct mem_cgroup *memcg)
3358 list_for_each_entry(params, &memcg->memcg_slab_caches, list) { 3364 list_for_each_entry(params, &memcg->memcg_slab_caches, list) {
3359 cachep = memcg_params_to_cache(params); 3365 cachep = memcg_params_to_cache(params);
3360 cachep->memcg_params->dead = true; 3366 cachep->memcg_params->dead = true;
3361 INIT_WORK(&cachep->memcg_params->destroy,
3362 kmem_cache_destroy_work_func);
3363 schedule_work(&cachep->memcg_params->destroy); 3367 schedule_work(&cachep->memcg_params->destroy);
3364 } 3368 }
3365 mutex_unlock(&memcg->slab_caches_mutex); 3369 mutex_unlock(&memcg->slab_caches_mutex);
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 31d26637b658..74310017296e 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2390,9 +2390,9 @@ restart:
2390 2390
2391 *mpol_new = *n->policy; 2391 *mpol_new = *n->policy;
2392 atomic_set(&mpol_new->refcnt, 1); 2392 atomic_set(&mpol_new->refcnt, 1);
2393 sp_node_init(n_new, n->end, end, mpol_new); 2393 sp_node_init(n_new, end, n->end, mpol_new);
2394 sp_insert(sp, n_new);
2395 n->end = start; 2394 n->end = start;
2395 sp_insert(sp, n_new);
2396 n_new = NULL; 2396 n_new = NULL;
2397 mpol_new = NULL; 2397 mpol_new = NULL;
2398 break; 2398 break;
diff --git a/net/9p/trans_virtio.c b/net/9p/trans_virtio.c
index 74dea377fe5b..de2e950a0a7a 100644
--- a/net/9p/trans_virtio.c
+++ b/net/9p/trans_virtio.c
@@ -655,7 +655,7 @@ static struct p9_trans_module p9_virtio_trans = {
655 .create = p9_virtio_create, 655 .create = p9_virtio_create,
656 .close = p9_virtio_close, 656 .close = p9_virtio_close,
657 .request = p9_virtio_request, 657 .request = p9_virtio_request,
658 //.zc_request = p9_virtio_zc_request, 658 .zc_request = p9_virtio_zc_request,
659 .cancel = p9_virtio_cancel, 659 .cancel = p9_virtio_cancel,
660 /* 660 /*
661 * We leave one entry for input and one entry for response 661 * We leave one entry for input and one entry for response