Commit fc3ac5c75bae55ca6a070eb72038a94d4f130d8d
Exists in
ti-lsk-linux-4.1.y
and in
12 other branches
Merge branch 'akpm' (incoming from Andrew)
Merge misc fixes from Andrew Morton: "9 fixes" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: MAINTAINERS: add closing angle bracket to Vince Bridgers' email address Documentation: fix DOCBOOKS=... building ocfs2: fix double kmem_cache_destroy in dlm_init mm/memory-failure.c: fix memory leak by race between poison and unpoison wait: swap EXIT_ZOMBIE(Z) and EXIT_DEAD(X) chars in TASK_STATE_TO_CHAR_STR memcg: fix swapcache charge from kernel thread context mm: madvise: fix MADV_WILLNEED on shmem swapouts mm/filemap.c: avoid always dirtying mapping->flags on O_DIRECT hwpoison, hugetlb: lock_page/unlock_page does not match for handling a free hugepage
Showing 8 changed files Side-by-side Diff
Documentation/DocBook/media/Makefile
... | ... | @@ -195,7 +195,7 @@ |
195 | 195 | # |
196 | 196 | |
197 | 197 | install_media_images = \ |
198 | - $(Q)cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api | |
198 | + $(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api | |
199 | 199 | |
200 | 200 | $(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64 |
201 | 201 | $(Q)base64 -d $< >$@ |
MAINTAINERS
... | ... | @@ -537,7 +537,7 @@ |
537 | 537 | F: arch/alpha/ |
538 | 538 | |
539 | 539 | ALTERA TRIPLE SPEED ETHERNET DRIVER |
540 | -M: Vince Bridgers <vbridgers2013@gmail.com | |
540 | +M: Vince Bridgers <vbridgers2013@gmail.com> | |
541 | 541 | L: netdev@vger.kernel.org |
542 | 542 | L: nios2-dev@lists.rocketboards.org (moderated for non-subscribers) |
543 | 543 | S: Maintained |
fs/ocfs2/dlm/dlmmaster.c
... | ... | @@ -472,11 +472,15 @@ |
472 | 472 | |
473 | 473 | void dlm_destroy_master_caches(void) |
474 | 474 | { |
475 | - if (dlm_lockname_cache) | |
475 | + if (dlm_lockname_cache) { | |
476 | 476 | kmem_cache_destroy(dlm_lockname_cache); |
477 | + dlm_lockname_cache = NULL; | |
478 | + } | |
477 | 479 | |
478 | - if (dlm_lockres_cache) | |
480 | + if (dlm_lockres_cache) { | |
479 | 481 | kmem_cache_destroy(dlm_lockres_cache); |
482 | + dlm_lockres_cache = NULL; | |
483 | + } | |
480 | 484 | } |
481 | 485 | |
482 | 486 | static void dlm_lockres_release(struct kref *kref) |
include/linux/sched.h
... | ... | @@ -220,7 +220,7 @@ |
220 | 220 | #define TASK_PARKED 512 |
221 | 221 | #define TASK_STATE_MAX 1024 |
222 | 222 | |
223 | -#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP" | |
223 | +#define TASK_STATE_TO_CHAR_STR "RSDTtXZxKWP" | |
224 | 224 | |
225 | 225 | extern char ___assert_task_state[1 - 2*!!( |
226 | 226 | sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)]; |
mm/filemap.c
... | ... | @@ -257,9 +257,11 @@ |
257 | 257 | { |
258 | 258 | int ret = 0; |
259 | 259 | /* Check for outstanding write errors */ |
260 | - if (test_and_clear_bit(AS_ENOSPC, &mapping->flags)) | |
260 | + if (test_bit(AS_ENOSPC, &mapping->flags) && | |
261 | + test_and_clear_bit(AS_ENOSPC, &mapping->flags)) | |
261 | 262 | ret = -ENOSPC; |
262 | - if (test_and_clear_bit(AS_EIO, &mapping->flags)) | |
263 | + if (test_bit(AS_EIO, &mapping->flags) && | |
264 | + test_and_clear_bit(AS_EIO, &mapping->flags)) | |
263 | 265 | ret = -EIO; |
264 | 266 | return ret; |
265 | 267 | } |
mm/madvise.c
... | ... | @@ -195,7 +195,7 @@ |
195 | 195 | for (; start < end; start += PAGE_SIZE) { |
196 | 196 | index = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff; |
197 | 197 | |
198 | - page = find_get_page(mapping, index); | |
198 | + page = find_get_entry(mapping, index); | |
199 | 199 | if (!radix_tree_exceptional_entry(page)) { |
200 | 200 | if (page) |
201 | 201 | page_cache_release(page); |
mm/memcontrol.c
... | ... | @@ -1077,9 +1077,18 @@ |
1077 | 1077 | |
1078 | 1078 | rcu_read_lock(); |
1079 | 1079 | do { |
1080 | - memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); | |
1081 | - if (unlikely(!memcg)) | |
1080 | + /* | |
1081 | + * Page cache insertions can happen withou an | |
1082 | + * actual mm context, e.g. during disk probing | |
1083 | + * on boot, loopback IO, acct() writes etc. | |
1084 | + */ | |
1085 | + if (unlikely(!mm)) | |
1082 | 1086 | memcg = root_mem_cgroup; |
1087 | + else { | |
1088 | + memcg = mem_cgroup_from_task(rcu_dereference(mm->owner)); | |
1089 | + if (unlikely(!memcg)) | |
1090 | + memcg = root_mem_cgroup; | |
1091 | + } | |
1083 | 1092 | } while (!css_tryget(&memcg->css)); |
1084 | 1093 | rcu_read_unlock(); |
1085 | 1094 | return memcg; |
... | ... | @@ -3958,17 +3967,9 @@ |
3958 | 3967 | return 0; |
3959 | 3968 | } |
3960 | 3969 | |
3961 | - /* | |
3962 | - * Page cache insertions can happen without an actual mm | |
3963 | - * context, e.g. during disk probing on boot. | |
3964 | - */ | |
3965 | - if (unlikely(!mm)) | |
3966 | - memcg = root_mem_cgroup; | |
3967 | - else { | |
3968 | - memcg = mem_cgroup_try_charge_mm(mm, gfp_mask, 1, true); | |
3969 | - if (!memcg) | |
3970 | - return -ENOMEM; | |
3971 | - } | |
3970 | + memcg = mem_cgroup_try_charge_mm(mm, gfp_mask, 1, true); | |
3971 | + if (!memcg) | |
3972 | + return -ENOMEM; | |
3972 | 3973 | __mem_cgroup_commit_charge(memcg, page, 1, type, false); |
3973 | 3974 | return 0; |
3974 | 3975 | } |
mm/memory-failure.c
... | ... | @@ -1081,15 +1081,16 @@ |
1081 | 1081 | return 0; |
1082 | 1082 | } else if (PageHuge(hpage)) { |
1083 | 1083 | /* |
1084 | - * Check "just unpoisoned", "filter hit", and | |
1085 | - * "race with other subpage." | |
1084 | + * Check "filter hit" and "race with other subpage." | |
1086 | 1085 | */ |
1087 | 1086 | lock_page(hpage); |
1088 | - if (!PageHWPoison(hpage) | |
1089 | - || (hwpoison_filter(p) && TestClearPageHWPoison(p)) | |
1090 | - || (p != hpage && TestSetPageHWPoison(hpage))) { | |
1091 | - atomic_long_sub(nr_pages, &num_poisoned_pages); | |
1092 | - return 0; | |
1087 | + if (PageHWPoison(hpage)) { | |
1088 | + if ((hwpoison_filter(p) && TestClearPageHWPoison(p)) | |
1089 | + || (p != hpage && TestSetPageHWPoison(hpage))) { | |
1090 | + atomic_long_sub(nr_pages, &num_poisoned_pages); | |
1091 | + unlock_page(hpage); | |
1092 | + return 0; | |
1093 | + } | |
1093 | 1094 | } |
1094 | 1095 | set_page_hwpoison_huge_page(hpage); |
1095 | 1096 | res = dequeue_hwpoisoned_huge_page(hpage); |
... | ... | @@ -1152,6 +1153,8 @@ |
1152 | 1153 | */ |
1153 | 1154 | if (!PageHWPoison(p)) { |
1154 | 1155 | printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn); |
1156 | + atomic_long_sub(nr_pages, &num_poisoned_pages); | |
1157 | + put_page(hpage); | |
1155 | 1158 | res = 0; |
1156 | 1159 | goto out; |
1157 | 1160 | } |