Commit 507053d2 authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'akpm' (patches from Andrew)

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()
parents be11f436 a810007a
...@@ -390,15 +390,13 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf) ...@@ -390,15 +390,13 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
result = VM_FAULT_LOCKED; result = VM_FAULT_LOCKED;
break; break;
case -ENODATA: case -ENODATA:
case -EAGAIN:
case -EFAULT: case -EFAULT:
result = VM_FAULT_NOPAGE; result = VM_FAULT_NOPAGE;
break; break;
case -ENOMEM: case -ENOMEM:
result = VM_FAULT_OOM; result = VM_FAULT_OOM;
break; break;
case -EAGAIN:
result = VM_FAULT_RETRY;
break;
default: default:
result = VM_FAULT_SIGBUS; result = VM_FAULT_SIGBUS;
break; break;
......
...@@ -243,12 +243,10 @@ static inline int block_page_mkwrite_return(int err) ...@@ -243,12 +243,10 @@ static inline int block_page_mkwrite_return(int err)
{ {
if (err == 0) if (err == 0)
return VM_FAULT_LOCKED; return VM_FAULT_LOCKED;
if (err == -EFAULT) if (err == -EFAULT || err == -EAGAIN)
return VM_FAULT_NOPAGE; return VM_FAULT_NOPAGE;
if (err == -ENOMEM) if (err == -ENOMEM)
return VM_FAULT_OOM; return VM_FAULT_OOM;
if (err == -EAGAIN)
return VM_FAULT_RETRY;
/* -ENOSPC, -EDQUOT, -EIO ... */ /* -ENOSPC, -EDQUOT, -EIO ... */
return VM_FAULT_SIGBUS; return VM_FAULT_SIGBUS;
} }
......
...@@ -560,7 +560,7 @@ static inline void cpumask_copy(struct cpumask *dstp, ...@@ -560,7 +560,7 @@ static inline void cpumask_copy(struct cpumask *dstp,
static inline int cpumask_parse_user(const char __user *buf, int len, static inline int cpumask_parse_user(const char __user *buf, int len,
struct cpumask *dstp) 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);
} }
/** /**
...@@ -575,7 +575,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len, ...@@ -575,7 +575,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len,
struct cpumask *dstp) struct cpumask *dstp)
{ {
return bitmap_parselist_user(buf, len, cpumask_bits(dstp), return bitmap_parselist_user(buf, len, cpumask_bits(dstp),
nr_cpu_ids); nr_cpumask_bits);
} }
/** /**
...@@ -590,7 +590,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp) ...@@ -590,7 +590,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
char *nl = strchr(buf, '\n'); char *nl = strchr(buf, '\n');
unsigned int len = nl ? (unsigned int)(nl - buf) : strlen(buf); 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);
} }
/** /**
...@@ -602,7 +602,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp) ...@@ -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) 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);
} }
/** /**
......
...@@ -227,11 +227,10 @@ static __init int user_namespace_sysctl_init(void) ...@@ -227,11 +227,10 @@ static __init int user_namespace_sysctl_init(void)
* properly. * properly.
*/ */
user_header = register_sysctl("user", empty); user_header = register_sysctl("user", empty);
kmemleak_ignore(user_header);
BUG_ON(!user_header); BUG_ON(!user_header);
BUG_ON(!setup_userns_sysctls(&init_user_ns)); BUG_ON(!setup_userns_sysctls(&init_user_ns));
#endif #endif
return 0; return 0;
} }
subsys_initcall(user_namespace_sysctl_init); subsys_initcall(user_namespace_sysctl_init);
...@@ -1422,6 +1422,10 @@ static int init_cache_random_seq(struct kmem_cache *s) ...@@ -1422,6 +1422,10 @@ static int init_cache_random_seq(struct kmem_cache *s)
int err; int err;
unsigned long i, count = oo_objects(s->oo); 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); err = cache_random_seq_create(s, count, GFP_KERNEL);
if (err) { if (err) {
pr_err("SLUB: Unable to initialize free list for %s\n", pr_err("SLUB: Unable to initialize free list for %s\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment