Skip to content

Commit 507053d

Browse files
committed
Merge branch 'akpm' (patches from Andrew)
Merge fixes from Andrew Morton: "4 fixes" * emailed patches from Andrew Morton <[email protected]>: 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()
2 parents be11f43 + a810007 commit 507053d

File tree

5 files changed

+11
-12
lines changed

5 files changed

+11
-12
lines changed

drivers/staging/lustre/lustre/llite/llite_mmap.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,15 +390,13 @@ static int ll_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf)
390390
result = VM_FAULT_LOCKED;
391391
break;
392392
case -ENODATA:
393+
case -EAGAIN:
393394
case -EFAULT:
394395
result = VM_FAULT_NOPAGE;
395396
break;
396397
case -ENOMEM:
397398
result = VM_FAULT_OOM;
398399
break;
399-
case -EAGAIN:
400-
result = VM_FAULT_RETRY;
401-
break;
402400
default:
403401
result = VM_FAULT_SIGBUS;
404402
break;

include/linux/buffer_head.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,12 +243,10 @@ static inline int block_page_mkwrite_return(int err)
243243
{
244244
if (err == 0)
245245
return VM_FAULT_LOCKED;
246-
if (err == -EFAULT)
246+
if (err == -EFAULT || err == -EAGAIN)
247247
return VM_FAULT_NOPAGE;
248248
if (err == -ENOMEM)
249249
return VM_FAULT_OOM;
250-
if (err == -EAGAIN)
251-
return VM_FAULT_RETRY;
252250
/* -ENOSPC, -EDQUOT, -EIO ... */
253251
return VM_FAULT_SIGBUS;
254252
}

include/linux/cpumask.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ static inline void cpumask_copy(struct cpumask *dstp,
560560
static inline int cpumask_parse_user(const char __user *buf, int len,
561561
struct cpumask *dstp)
562562
{
563-
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpu_ids);
563+
return bitmap_parse_user(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
564564
}
565565

566566
/**
@@ -575,7 +575,7 @@ static inline int cpumask_parselist_user(const char __user *buf, int len,
575575
struct cpumask *dstp)
576576
{
577577
return bitmap_parselist_user(buf, len, cpumask_bits(dstp),
578-
nr_cpu_ids);
578+
nr_cpumask_bits);
579579
}
580580

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

593-
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpu_ids);
593+
return bitmap_parse(buf, len, cpumask_bits(dstp), nr_cpumask_bits);
594594
}
595595

596596
/**
@@ -602,7 +602,7 @@ static inline int cpumask_parse(const char *buf, struct cpumask *dstp)
602602
*/
603603
static inline int cpulist_parse(const char *buf, struct cpumask *dstp)
604604
{
605-
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpu_ids);
605+
return bitmap_parselist(buf, cpumask_bits(dstp), nr_cpumask_bits);
606606
}
607607

608608
/**

kernel/ucount.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,11 +227,10 @@ static __init int user_namespace_sysctl_init(void)
227227
* properly.
228228
*/
229229
user_header = register_sysctl("user", empty);
230+
kmemleak_ignore(user_header);
230231
BUG_ON(!user_header);
231232
BUG_ON(!setup_userns_sysctls(&init_user_ns));
232233
#endif
233234
return 0;
234235
}
235236
subsys_initcall(user_namespace_sysctl_init);
236-
237-

mm/slub.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1422,6 +1422,10 @@ static int init_cache_random_seq(struct kmem_cache *s)
14221422
int err;
14231423
unsigned long i, count = oo_objects(s->oo);
14241424

1425+
/* Bailout if already initialised */
1426+
if (s->random_seq)
1427+
return 0;
1428+
14251429
err = cache_random_seq_create(s, count, GFP_KERNEL);
14261430
if (err) {
14271431
pr_err("SLUB: Unable to initialize free list for %s\n",

0 commit comments

Comments
 (0)