Skip to content

Commit

Permalink
Merge branch 'akpm' (incoming from Andrew)
Browse files Browse the repository at this point in the history
Merge misc fixes from Andrew Morton:
 "9 fixes"

* emailed patches from Andrew Morton <[email protected]>:
  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
  • Loading branch information
torvalds committed May 23, 2014
2 parents 9abd09a + 0d9327a commit fc3ac5c
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Documentation/DocBook/media/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ DVB_DOCUMENTED = \
#

install_media_images = \
$(Q)cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api
$(Q)-cp $(OBJIMGFILES) $(MEDIA_SRC_DIR)/v4l/*.svg $(MEDIA_OBJ_DIR)/media_api

$(MEDIA_OBJ_DIR)/%: $(MEDIA_SRC_DIR)/%.b64
$(Q)base64 -d $< >$@
Expand Down
2 changes: 1 addition & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ L: [email protected]
F: arch/alpha/

ALTERA TRIPLE SPEED ETHERNET DRIVER
M: Vince Bridgers <[email protected]
M: Vince Bridgers <[email protected]>
L: [email protected]
L: [email protected] (moderated for non-subscribers)
S: Maintained
Expand Down
8 changes: 6 additions & 2 deletions fs/ocfs2/dlm/dlmmaster.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,11 +472,15 @@ int dlm_init_master_caches(void)

void dlm_destroy_master_caches(void)
{
if (dlm_lockname_cache)
if (dlm_lockname_cache) {
kmem_cache_destroy(dlm_lockname_cache);
dlm_lockname_cache = NULL;
}

if (dlm_lockres_cache)
if (dlm_lockres_cache) {
kmem_cache_destroy(dlm_lockres_cache);
dlm_lockres_cache = NULL;
}
}

static void dlm_lockres_release(struct kref *kref)
Expand Down
2 changes: 1 addition & 1 deletion include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq);
#define TASK_PARKED 512
#define TASK_STATE_MAX 1024

#define TASK_STATE_TO_CHAR_STR "RSDTtZXxKWP"
#define TASK_STATE_TO_CHAR_STR "RSDTtXZxKWP"

extern char ___assert_task_state[1 - 2*!!(
sizeof(TASK_STATE_TO_CHAR_STR)-1 != ilog2(TASK_STATE_MAX)+1)];
Expand Down
6 changes: 4 additions & 2 deletions mm/filemap.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,11 @@ static int filemap_check_errors(struct address_space *mapping)
{
int ret = 0;
/* Check for outstanding write errors */
if (test_and_clear_bit(AS_ENOSPC, &mapping->flags))
if (test_bit(AS_ENOSPC, &mapping->flags) &&
test_and_clear_bit(AS_ENOSPC, &mapping->flags))
ret = -ENOSPC;
if (test_and_clear_bit(AS_EIO, &mapping->flags))
if (test_bit(AS_EIO, &mapping->flags) &&
test_and_clear_bit(AS_EIO, &mapping->flags))
ret = -EIO;
return ret;
}
Expand Down
2 changes: 1 addition & 1 deletion mm/madvise.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static void force_shm_swapin_readahead(struct vm_area_struct *vma,
for (; start < end; start += PAGE_SIZE) {
index = ((start - vma->vm_start) >> PAGE_SHIFT) + vma->vm_pgoff;

page = find_get_page(mapping, index);
page = find_get_entry(mapping, index);
if (!radix_tree_exceptional_entry(page)) {
if (page)
page_cache_release(page);
Expand Down
27 changes: 14 additions & 13 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,9 +1077,18 @@ static struct mem_cgroup *get_mem_cgroup_from_mm(struct mm_struct *mm)

rcu_read_lock();
do {
memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
if (unlikely(!memcg))
/*
* Page cache insertions can happen withou an
* actual mm context, e.g. during disk probing
* on boot, loopback IO, acct() writes etc.
*/
if (unlikely(!mm))
memcg = root_mem_cgroup;
else {
memcg = mem_cgroup_from_task(rcu_dereference(mm->owner));
if (unlikely(!memcg))
memcg = root_mem_cgroup;
}
} while (!css_tryget(&memcg->css));
rcu_read_unlock();
return memcg;
Expand Down Expand Up @@ -3958,17 +3967,9 @@ int mem_cgroup_charge_file(struct page *page, struct mm_struct *mm,
return 0;
}

/*
* Page cache insertions can happen without an actual mm
* context, e.g. during disk probing on boot.
*/
if (unlikely(!mm))
memcg = root_mem_cgroup;
else {
memcg = mem_cgroup_try_charge_mm(mm, gfp_mask, 1, true);
if (!memcg)
return -ENOMEM;
}
memcg = mem_cgroup_try_charge_mm(mm, gfp_mask, 1, true);
if (!memcg)
return -ENOMEM;
__mem_cgroup_commit_charge(memcg, page, 1, type, false);
return 0;
}
Expand Down
17 changes: 10 additions & 7 deletions mm/memory-failure.c
Original file line number Diff line number Diff line change
Expand Up @@ -1081,15 +1081,16 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
return 0;
} else if (PageHuge(hpage)) {
/*
* Check "just unpoisoned", "filter hit", and
* "race with other subpage."
* Check "filter hit" and "race with other subpage."
*/
lock_page(hpage);
if (!PageHWPoison(hpage)
|| (hwpoison_filter(p) && TestClearPageHWPoison(p))
|| (p != hpage && TestSetPageHWPoison(hpage))) {
atomic_long_sub(nr_pages, &num_poisoned_pages);
return 0;
if (PageHWPoison(hpage)) {
if ((hwpoison_filter(p) && TestClearPageHWPoison(p))
|| (p != hpage && TestSetPageHWPoison(hpage))) {
atomic_long_sub(nr_pages, &num_poisoned_pages);
unlock_page(hpage);
return 0;
}
}
set_page_hwpoison_huge_page(hpage);
res = dequeue_hwpoisoned_huge_page(hpage);
Expand Down Expand Up @@ -1152,6 +1153,8 @@ int memory_failure(unsigned long pfn, int trapno, int flags)
*/
if (!PageHWPoison(p)) {
printk(KERN_ERR "MCE %#lx: just unpoisoned\n", pfn);
atomic_long_sub(nr_pages, &num_poisoned_pages);
put_page(hpage);
res = 0;
goto out;
}
Expand Down

0 comments on commit fc3ac5c

Please sign in to comment.