Skip to content

Commit

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

* emailed patches from Andrew Morton <akpm@linux-foundation.org>:
  mm/slub.c: fix random_seq offset destruction
  cpumask: use nr_cpumask_bits for parsing functions
  mm: avoid returning VM_FAULT_RETRY from ->page_mkwrite handlers
  kernel/ucount.c: mark user_header with kmemleak_ignore()
  • Loading branch information
Linus Torvalds committed Feb 9, 2017
2 parents be11f43 + a810007 commit 507053d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 12 deletions.
4 changes: 1 addition & 3 deletions drivers/staging/lustre/lustre/llite/llite_mmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,15 +390,13 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
result = VM_FAULT_LOCKED;
break;
case -ENODATA:
case -EAGAIN:
case -EFAULT:
result = VM_FAULT_NOPAGE;
break;
case -ENOMEM:
result = VM_FAULT_OOM;
break;
case -EAGAIN:
result = VM_FAULT_RETRY;
break;
default:
result = VM_FAULT_SIGBUS;
break;
Expand Down
4 changes: 1 addition & 3 deletions include/linux/buffer_head.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,10 @@ static inline int block_page_mkwrite_return(int err)
{
if (err == 0)
return VM_FAULT_LOCKED;
if (err == -EFAULT)
if (err == -EFAULT || err == -EAGAIN)
return VM_FAULT_NOPAGE;
if (err == -ENOMEM)
return VM_FAULT_OOM;
if (err == -EAGAIN)
return VM_FAULT_RETRY;
/* -ENOSPC, -EDQUOT, -EIO ... */
return VM_FAULT_SIGBUS;
}
Expand Down
8 changes: 4 additions & 4 deletions include/linux/cpumask.h
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ static inline void cpumask_copy(struct cpumask *dstp,
static inline int cpumask_parse_user(const char __user *buf, int len,
struct cpumask *dstp)
{
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpu_ids);
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
}

/**
Expand All @@ -575,7 +575,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len,
struct cpumask *dstp)
{
return bitmap_parselist_user(buf, len, cpumask_bits(dstp),
nr_cpu_ids);
nr_cpumask_bits);
}

/**
Expand All @@ -590,7 +590,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
char *nl = strchr(buf, '\n');
unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf);

return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpu_ids);
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
}

/**
Expand All @@ -602,7 +602,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
*/
static inline int cpulist_parse(const char *buf, struct cpumask *dstp)
{
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpu_ids);
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits);
}

/**
Expand Down
3 changes: 1 addition & 2 deletions kernel/ucount.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,11 +227,10 @@ static __init int user_namespace_sysctl_init(void)
* properly.
*/
user_header = register_sysctl("user", empty);
kmemleak_ignore(user_header);
BUG_ON(!user_header);
BUG_ON(!setup_userns_sysctls(&init_user_ns));
#endif
return 0;
}
subsys_initcall(user_namespace_sysctl_init);


4 changes: 4 additions & 0 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -1422,6 +1422,10 @@ static int init_cache_random_seq(struct kmem_cache *s)
int err;
unsigned long i, count = oo_objects(s->oo);

/* Bailout if already initialised */
if (s->random_seq)
return 0;

err = cache_random_seq_create(s, count, GFP_KERNEL);
if (err) {
pr_err("SLUB: Unable to initialize free list for %s\n",
Expand Down

0 comments on commit 507053d

Please sign in to comment.