aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJiri Kosina <jkosina@suse.cz>2008-05-20 10:43:50 -0400
committerJiri Kosina <jkosina@suse.cz>2008-05-20 10:43:50 -0400
commit2d4b3f37ded8998a362c8d0b4be02f583dd9a002 (patch)
tree5c66ddaf0a6ab6d898931a5ed58c7aa844b94740 /kernel
parent7022b15e2a9f878fd5184586064c63352c3dd225 (diff)
parent8033c6e9736c29cce5f0d0abbca9a44dffb20c39 (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c11
-rw-r--r--kernel/audit_tree.c5
-rw-r--r--kernel/cpuset.c52
-rw-r--r--kernel/fork.c130
-rw-r--r--kernel/kgdb.c8
-rw-r--r--kernel/module.c25
-rw-r--r--kernel/relay.c2
-rw-r--r--kernel/sched.c31
-rw-r--r--kernel/sched_fair.c11
-rw-r--r--kernel/sysctl.c5
10 files changed, 83 insertions, 197 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index b7d3709cc452..e8692a5748c2 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -572,16 +572,17 @@ void audit_send_reply(int pid, int seq, int type, int done, int multi,
572 572
573 skb = audit_make_reply(pid, seq, type, done, multi, payload, size); 573 skb = audit_make_reply(pid, seq, type, done, multi, payload, size);
574 if (!skb) 574 if (!skb)
575 return; 575 goto out;
576 576
577 reply->pid = pid; 577 reply->pid = pid;
578 reply->skb = skb; 578 reply->skb = skb;
579 579
580 tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply"); 580 tsk = kthread_run(audit_send_reply_thread, reply, "audit_send_reply");
581 if (IS_ERR(tsk)) { 581 if (!IS_ERR(tsk))
582 kfree(reply); 582 return;
583 kfree_skb(skb); 583 kfree_skb(skb);
584 } 584out:
585 kfree(reply);
585} 586}
586 587
587/* 588/*
diff --git a/kernel/audit_tree.c b/kernel/audit_tree.c
index 9ef5e0aacc3c..f7921a2ecf16 100644
--- a/kernel/audit_tree.c
+++ b/kernel/audit_tree.c
@@ -172,10 +172,9 @@ static void insert_hash(struct audit_chunk *chunk)
172struct audit_chunk *audit_tree_lookup(const struct inode *inode) 172struct audit_chunk *audit_tree_lookup(const struct inode *inode)
173{ 173{
174 struct list_head *list = chunk_hash(inode); 174 struct list_head *list = chunk_hash(inode);
175 struct list_head *pos; 175 struct audit_chunk *p;
176 176
177 list_for_each_rcu(pos, list) { 177 list_for_each_entry_rcu(p, list, hash) {
178 struct audit_chunk *p = container_of(pos, struct audit_chunk, hash);
179 if (p->watch.inode == inode) { 178 if (p->watch.inode == inode) {
180 get_inotify_watch(&p->watch); 179 get_inotify_watch(&p->watch);
181 return p; 180 return p;
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 8da627d33804..86ea9e34e326 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -1031,11 +1031,9 @@ int current_cpuset_is_being_rebound(void)
1031 return task_cs(current) == cpuset_being_rebound; 1031 return task_cs(current) == cpuset_being_rebound;
1032} 1032}
1033 1033
1034static int update_relax_domain_level(struct cpuset *cs, char *buf) 1034static int update_relax_domain_level(struct cpuset *cs, s64 val)
1035{ 1035{
1036 int val = simple_strtol(buf, NULL, 10); 1036 if ((int)val < 0)
1037
1038 if (val < 0)
1039 val = -1; 1037 val = -1;
1040 1038
1041 if (val != cs->relax_domain_level) { 1039 if (val != cs->relax_domain_level) {
@@ -1280,9 +1278,6 @@ static ssize_t cpuset_common_file_write(struct cgroup *cont,
1280 case FILE_MEMLIST: 1278 case FILE_MEMLIST:
1281 retval = update_nodemask(cs, buffer); 1279 retval = update_nodemask(cs, buffer);
1282 break; 1280 break;
1283 case FILE_SCHED_RELAX_DOMAIN_LEVEL:
1284 retval = update_relax_domain_level(cs, buffer);
1285 break;
1286 default: 1281 default:
1287 retval = -EINVAL; 1282 retval = -EINVAL;
1288 goto out2; 1283 goto out2;
@@ -1348,6 +1343,30 @@ static int cpuset_write_u64(struct cgroup *cgrp, struct cftype *cft, u64 val)
1348 return retval; 1343 return retval;
1349} 1344}
1350 1345
1346static int cpuset_write_s64(struct cgroup *cgrp, struct cftype *cft, s64 val)
1347{
1348 int retval = 0;
1349 struct cpuset *cs = cgroup_cs(cgrp);
1350 cpuset_filetype_t type = cft->private;
1351
1352 cgroup_lock();
1353
1354 if (cgroup_is_removed(cgrp)) {
1355 cgroup_unlock();
1356 return -ENODEV;
1357 }
1358 switch (type) {
1359 case FILE_SCHED_RELAX_DOMAIN_LEVEL:
1360 retval = update_relax_domain_level(cs, val);
1361 break;
1362 default:
1363 retval = -EINVAL;
1364 break;
1365 }
1366 cgroup_unlock();
1367 return retval;
1368}
1369
1351/* 1370/*
1352 * These ascii lists should be read in a single call, by using a user 1371 * These ascii lists should be read in a single call, by using a user
1353 * buffer large enough to hold the entire map. If read in smaller 1372 * buffer large enough to hold the entire map. If read in smaller
@@ -1406,9 +1425,6 @@ static ssize_t cpuset_common_file_read(struct cgroup *cont,
1406 case FILE_MEMLIST: 1425 case FILE_MEMLIST:
1407 s += cpuset_sprintf_memlist(s, cs); 1426 s += cpuset_sprintf_memlist(s, cs);
1408 break; 1427 break;
1409 case FILE_SCHED_RELAX_DOMAIN_LEVEL:
1410 s += sprintf(s, "%d", cs->relax_domain_level);
1411 break;
1412 default: 1428 default:
1413 retval = -EINVAL; 1429 retval = -EINVAL;
1414 goto out; 1430 goto out;
@@ -1449,6 +1465,18 @@ static u64 cpuset_read_u64(struct cgroup *cont, struct cftype *cft)
1449 } 1465 }
1450} 1466}
1451 1467
1468static s64 cpuset_read_s64(struct cgroup *cont, struct cftype *cft)
1469{
1470 struct cpuset *cs = cgroup_cs(cont);
1471 cpuset_filetype_t type = cft->private;
1472 switch (type) {
1473 case FILE_SCHED_RELAX_DOMAIN_LEVEL:
1474 return cs->relax_domain_level;
1475 default:
1476 BUG();
1477 }
1478}
1479
1452 1480
1453/* 1481/*
1454 * for the common functions, 'private' gives the type of file 1482 * for the common functions, 'private' gives the type of file
@@ -1499,8 +1527,8 @@ static struct cftype files[] = {
1499 1527
1500 { 1528 {
1501 .name = "sched_relax_domain_level", 1529 .name = "sched_relax_domain_level",
1502 .read_u64 = cpuset_read_u64, 1530 .read_s64 = cpuset_read_s64,
1503 .write_u64 = cpuset_write_u64, 1531 .write_s64 = cpuset_write_s64,
1504 .private = FILE_SCHED_RELAX_DOMAIN_LEVEL, 1532 .private = FILE_SCHED_RELAX_DOMAIN_LEVEL,
1505 }, 1533 },
1506 1534
diff --git a/kernel/fork.c b/kernel/fork.c
index 933e60ebccae..19908b26cf80 100644
--- a/kernel/fork.c
+++ b/kernel/fork.c
@@ -660,136 +660,6 @@ static int copy_fs(unsigned long clone_flags, struct task_struct *tsk)
660 return 0; 660 return 0;
661} 661}
662 662
663static int count_open_files(struct fdtable *fdt)
664{
665 int size = fdt->max_fds;
666 int i;
667
668 /* Find the last open fd */
669 for (i = size/(8*sizeof(long)); i > 0; ) {
670 if (fdt->open_fds->fds_bits[--i])
671 break;
672 }
673 i = (i+1) * 8 * sizeof(long);
674 return i;
675}
676
677static struct files_struct *alloc_files(void)
678{
679 struct files_struct *newf;
680 struct fdtable *fdt;
681
682 newf = kmem_cache_alloc(files_cachep, GFP_KERNEL);
683 if (!newf)
684 goto out;
685
686 atomic_set(&newf->count, 1);
687
688 spin_lock_init(&newf->file_lock);
689 newf->next_fd = 0;
690 fdt = &newf->fdtab;
691 fdt->max_fds = NR_OPEN_DEFAULT;
692 fdt->close_on_exec = (fd_set *)&newf->close_on_exec_init;
693 fdt->open_fds = (fd_set *)&newf->open_fds_init;
694 fdt->fd = &newf->fd_array[0];
695 INIT_RCU_HEAD(&fdt->rcu);
696 fdt->next = NULL;
697 rcu_assign_pointer(newf->fdt, fdt);
698out:
699 return newf;
700}
701
702/*
703 * Allocate a new files structure and copy contents from the
704 * passed in files structure.
705 * errorp will be valid only when the returned files_struct is NULL.
706 */
707static struct files_struct *dup_fd(struct files_struct *oldf, int *errorp)
708{
709 struct files_struct *newf;
710 struct file **old_fds, **new_fds;
711 int open_files, size, i;
712 struct fdtable *old_fdt, *new_fdt;
713
714 *errorp = -ENOMEM;
715 newf = alloc_files();
716 if (!newf)
717 goto out;
718
719 spin_lock(&oldf->file_lock);
720 old_fdt = files_fdtable(oldf);
721 new_fdt = files_fdtable(newf);
722 open_files = count_open_files(old_fdt);
723
724 /*
725 * Check whether we need to allocate a larger fd array and fd set.
726 * Note: we're not a clone task, so the open count won't change.
727 */
728 if (open_files > new_fdt->max_fds) {
729 new_fdt->max_fds = 0;
730 spin_unlock(&oldf->file_lock);
731 spin_lock(&newf->file_lock);
732 *errorp = expand_files(newf, open_files-1);
733 spin_unlock(&newf->file_lock);
734 if (*errorp < 0)
735 goto out_release;
736 new_fdt = files_fdtable(newf);
737 /*
738 * Reacquire the oldf lock and a pointer to its fd table
739 * who knows it may have a new bigger fd table. We need
740 * the latest pointer.
741 */
742 spin_lock(&oldf->file_lock);
743 old_fdt = files_fdtable(oldf);
744 }
745
746 old_fds = old_fdt->fd;
747 new_fds = new_fdt->fd;
748
749 memcpy(new_fdt->open_fds->fds_bits,
750 old_fdt->open_fds->fds_bits, open_files/8);
751 memcpy(new_fdt->close_on_exec->fds_bits,
752 old_fdt->close_on_exec->fds_bits, open_files/8);
753
754 for (i = open_files; i != 0; i--) {
755 struct file *f = *old_fds++;
756 if (f) {
757 get_file(f);
758 } else {
759 /*
760 * The fd may be claimed in the fd bitmap but not yet
761 * instantiated in the files array if a sibling thread
762 * is partway through open(). So make sure that this
763 * fd is available to the new process.
764 */
765 FD_CLR(open_files - i, new_fdt->open_fds);
766 }
767 rcu_assign_pointer(*new_fds++, f);
768 }
769 spin_unlock(&oldf->file_lock);
770
771 /* compute the remainder to be cleared */
772 size = (new_fdt->max_fds - open_files) * sizeof(struct file *);
773
774 /* This is long word aligned thus could use a optimized version */
775 memset(new_fds, 0, size);
776
777 if (new_fdt->max_fds > open_files) {
778 int left = (new_fdt->max_fds-open_files)/8;
779 int start = open_files / (8 * sizeof(unsigned long));
780
781 memset(&new_fdt->open_fds->fds_bits[start], 0, left);
782 memset(&new_fdt->close_on_exec->fds_bits[start], 0, left);
783 }
784
785 return newf;
786
787out_release:
788 kmem_cache_free(files_cachep, newf);
789out:
790 return NULL;
791}
792
793static int copy_files(unsigned long clone_flags, struct task_struct * tsk) 663static int copy_files(unsigned long clone_flags, struct task_struct * tsk)
794{ 664{
795 struct files_struct *oldf, *newf; 665 struct files_struct *oldf, *newf;
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index 39e31a036f5b..14787de568b3 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -346,14 +346,6 @@ static void put_packet(char *buffer)
346 } 346 }
347} 347}
348 348
349static char *pack_hex_byte(char *pkt, u8 byte)
350{
351 *pkt++ = hexchars[byte >> 4];
352 *pkt++ = hexchars[byte & 0xf];
353
354 return pkt;
355}
356
357/* 349/*
358 * Convert the memory pointed to by mem into hex, placing result in buf. 350 * Convert the memory pointed to by mem into hex, placing result in buf.
359 * Return a pointer to the last char put in buf (null). May return an error. 351 * Return a pointer to the last char put in buf (null). May return an error.
diff --git a/kernel/module.c b/kernel/module.c
index 8e4528c9909f..f5e9491ef7ac 100644
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -917,6 +917,10 @@ static int check_version(Elf_Shdr *sechdrs,
917 if (!crc) 917 if (!crc)
918 return 1; 918 return 1;
919 919
920 /* No versions at all? modprobe --force does this. */
921 if (versindex == 0)
922 return try_to_force_load(mod, symname) == 0;
923
920 versions = (void *) sechdrs[versindex].sh_addr; 924 versions = (void *) sechdrs[versindex].sh_addr;
921 num_versions = sechdrs[versindex].sh_size 925 num_versions = sechdrs[versindex].sh_size
922 / sizeof(struct modversion_info); 926 / sizeof(struct modversion_info);
@@ -932,8 +936,9 @@ static int check_version(Elf_Shdr *sechdrs,
932 goto bad_version; 936 goto bad_version;
933 } 937 }
934 938
935 if (!try_to_force_load(mod, symname)) 939 printk(KERN_WARNING "%s: no symbol version for %s\n",
936 return 1; 940 mod->name, symname);
941 return 0;
937 942
938bad_version: 943bad_version:
939 printk("%s: disagrees about version of symbol %s\n", 944 printk("%s: disagrees about version of symbol %s\n",
@@ -952,11 +957,14 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs,
952 return check_version(sechdrs, versindex, "struct_module", mod, crc); 957 return check_version(sechdrs, versindex, "struct_module", mod, crc);
953} 958}
954 959
955/* First part is kernel version, which we ignore. */ 960/* First part is kernel version, which we ignore if module has crcs. */
956static inline int same_magic(const char *amagic, const char *bmagic) 961static inline int same_magic(const char *amagic, const char *bmagic,
962 bool has_crcs)
957{ 963{
958 amagic += strcspn(amagic, " "); 964 if (has_crcs) {
959 bmagic += strcspn(bmagic, " "); 965 amagic += strcspn(amagic, " ");
966 bmagic += strcspn(bmagic, " ");
967 }
960 return strcmp(amagic, bmagic) == 0; 968 return strcmp(amagic, bmagic) == 0;
961} 969}
962#else 970#else
@@ -976,7 +984,8 @@ static inline int check_modstruct_version(Elf_Shdr *sechdrs,
976 return 1; 984 return 1;
977} 985}
978 986
979static inline int same_magic(const char *amagic, const char *bmagic) 987static inline int same_magic(const char *amagic, const char *bmagic,
988 bool has_crcs)
980{ 989{
981 return strcmp(amagic, bmagic) == 0; 990 return strcmp(amagic, bmagic) == 0;
982} 991}
@@ -1869,7 +1878,7 @@ static struct module *load_module(void __user *umod,
1869 err = try_to_force_load(mod, "magic"); 1878 err = try_to_force_load(mod, "magic");
1870 if (err) 1879 if (err)
1871 goto free_hdr; 1880 goto free_hdr;
1872 } else if (!same_magic(modmagic, vermagic)) { 1881 } else if (!same_magic(modmagic, vermagic, versindex)) {
1873 printk(KERN_ERR "%s: version magic '%s' should be '%s'\n", 1882 printk(KERN_ERR "%s: version magic '%s' should be '%s'\n",
1874 mod->name, modmagic, vermagic); 1883 mod->name, modmagic, vermagic);
1875 err = -ENOEXEC; 1884 err = -ENOEXEC;
diff --git a/kernel/relay.c b/kernel/relay.c
index 7de644cdec43..bc24dcdc570f 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -1191,7 +1191,7 @@ static ssize_t relay_file_splice_read(struct file *in,
1191 ret = 0; 1191 ret = 0;
1192 spliced = 0; 1192 spliced = 0;
1193 1193
1194 while (len && !spliced) { 1194 while (len) {
1195 ret = subbuf_splice_actor(in, ppos, pipe, len, flags, &nonpad_ret); 1195 ret = subbuf_splice_actor(in, ppos, pipe, len, flags, &nonpad_ret);
1196 if (ret < 0) 1196 if (ret < 0)
1197 break; 1197 break;
diff --git a/kernel/sched.c b/kernel/sched.c
index 58fb8af15776..cfa222a91539 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -4567,8 +4567,6 @@ EXPORT_SYMBOL(schedule);
4567asmlinkage void __sched preempt_schedule(void) 4567asmlinkage void __sched preempt_schedule(void)
4568{ 4568{
4569 struct thread_info *ti = current_thread_info(); 4569 struct thread_info *ti = current_thread_info();
4570 struct task_struct *task = current;
4571 int saved_lock_depth;
4572 4570
4573 /* 4571 /*
4574 * If there is a non-zero preempt_count or interrupts are disabled, 4572 * If there is a non-zero preempt_count or interrupts are disabled,
@@ -4579,16 +4577,7 @@ asmlinkage void __sched preempt_schedule(void)
4579 4577
4580 do { 4578 do {
4581 add_preempt_count(PREEMPT_ACTIVE); 4579 add_preempt_count(PREEMPT_ACTIVE);
4582
4583 /*
4584 * We keep the big kernel semaphore locked, but we
4585 * clear ->lock_depth so that schedule() doesnt
4586 * auto-release the semaphore:
4587 */
4588 saved_lock_depth = task->lock_depth;
4589 task->lock_depth = -1;
4590 schedule(); 4580 schedule();
4591 task->lock_depth = saved_lock_depth;
4592 sub_preempt_count(PREEMPT_ACTIVE); 4581 sub_preempt_count(PREEMPT_ACTIVE);
4593 4582
4594 /* 4583 /*
@@ -4609,26 +4598,15 @@ EXPORT_SYMBOL(preempt_schedule);
4609asmlinkage void __sched preempt_schedule_irq(void) 4598asmlinkage void __sched preempt_schedule_irq(void)
4610{ 4599{
4611 struct thread_info *ti = current_thread_info(); 4600 struct thread_info *ti = current_thread_info();
4612 struct task_struct *task = current;
4613 int saved_lock_depth;
4614 4601
4615 /* Catch callers which need to be fixed */ 4602 /* Catch callers which need to be fixed */
4616 BUG_ON(ti->preempt_count || !irqs_disabled()); 4603 BUG_ON(ti->preempt_count || !irqs_disabled());
4617 4604
4618 do { 4605 do {
4619 add_preempt_count(PREEMPT_ACTIVE); 4606 add_preempt_count(PREEMPT_ACTIVE);
4620
4621 /*
4622 * We keep the big kernel semaphore locked, but we
4623 * clear ->lock_depth so that schedule() doesnt
4624 * auto-release the semaphore:
4625 */
4626 saved_lock_depth = task->lock_depth;
4627 task->lock_depth = -1;
4628 local_irq_enable(); 4607 local_irq_enable();
4629 schedule(); 4608 schedule();
4630 local_irq_disable(); 4609 local_irq_disable();
4631 task->lock_depth = saved_lock_depth;
4632 sub_preempt_count(PREEMPT_ACTIVE); 4610 sub_preempt_count(PREEMPT_ACTIVE);
4633 4611
4634 /* 4612 /*
@@ -5547,7 +5525,6 @@ static void __cond_resched(void)
5547 } while (need_resched()); 5525 } while (need_resched());
5548} 5526}
5549 5527
5550#if !defined(CONFIG_PREEMPT) || defined(CONFIG_PREEMPT_VOLUNTARY)
5551int __sched _cond_resched(void) 5528int __sched _cond_resched(void)
5552{ 5529{
5553 if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) && 5530 if (need_resched() && !(preempt_count() & PREEMPT_ACTIVE) &&
@@ -5558,7 +5535,6 @@ int __sched _cond_resched(void)
5558 return 0; 5535 return 0;
5559} 5536}
5560EXPORT_SYMBOL(_cond_resched); 5537EXPORT_SYMBOL(_cond_resched);
5561#endif
5562 5538
5563/* 5539/*
5564 * cond_resched_lock() - if a reschedule is pending, drop the given lock, 5540 * cond_resched_lock() - if a reschedule is pending, drop the given lock,
@@ -5853,8 +5829,11 @@ void __cpuinit init_idle(struct task_struct *idle, int cpu)
5853 spin_unlock_irqrestore(&rq->lock, flags); 5829 spin_unlock_irqrestore(&rq->lock, flags);
5854 5830
5855 /* Set the preempt count _outside_ the spinlocks! */ 5831 /* Set the preempt count _outside_ the spinlocks! */
5832#if defined(CONFIG_PREEMPT)
5833 task_thread_info(idle)->preempt_count = (idle->lock_depth >= 0);
5834#else
5856 task_thread_info(idle)->preempt_count = 0; 5835 task_thread_info(idle)->preempt_count = 0;
5857 5836#endif
5858 /* 5837 /*
5859 * The idle tasks have their own, simple scheduling class: 5838 * The idle tasks have their own, simple scheduling class:
5860 */ 5839 */
@@ -9007,7 +8986,7 @@ static u64 cpu_shares_read_u64(struct cgroup *cgrp, struct cftype *cft)
9007#endif 8986#endif
9008 8987
9009#ifdef CONFIG_RT_GROUP_SCHED 8988#ifdef CONFIG_RT_GROUP_SCHED
9010static ssize_t cpu_rt_runtime_write(struct cgroup *cgrp, struct cftype *cft, 8989static int cpu_rt_runtime_write(struct cgroup *cgrp, struct cftype *cft,
9011 s64 val) 8990 s64 val)
9012{ 8991{
9013 return sched_group_set_rt_runtime(cgroup_tg(cgrp), val); 8992 return sched_group_set_rt_runtime(cgroup_tg(cgrp), val);
diff --git a/kernel/sched_fair.c b/kernel/sched_fair.c
index c863663d204d..e24ecd39c4b8 100644
--- a/kernel/sched_fair.c
+++ b/kernel/sched_fair.c
@@ -662,10 +662,15 @@ place_entity(struct cfs_rq *cfs_rq, struct sched_entity *se, int initial)
662 if (!initial) { 662 if (!initial) {
663 /* sleeps upto a single latency don't count. */ 663 /* sleeps upto a single latency don't count. */
664 if (sched_feat(NEW_FAIR_SLEEPERS)) { 664 if (sched_feat(NEW_FAIR_SLEEPERS)) {
665 unsigned long thresh = sysctl_sched_latency;
666
667 /*
668 * convert the sleeper threshold into virtual time
669 */
665 if (sched_feat(NORMALIZED_SLEEPER)) 670 if (sched_feat(NORMALIZED_SLEEPER))
666 vruntime -= calc_delta_weight(sysctl_sched_latency, se); 671 thresh = calc_delta_fair(thresh, se);
667 else 672
668 vruntime -= sysctl_sched_latency; 673 vruntime -= thresh;
669 } 674 }
670 675
671 /* ensure we never gain time by being placed backwards. */ 676 /* ensure we never gain time by being placed backwards. */
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index d7ffdc59816a..29116652dca8 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -81,6 +81,7 @@ extern int compat_log;
81extern int maps_protect; 81extern int maps_protect;
82extern int sysctl_stat_interval; 82extern int sysctl_stat_interval;
83extern int latencytop_enabled; 83extern int latencytop_enabled;
84extern int sysctl_nr_open_min, sysctl_nr_open_max;
84 85
85/* Constants used for minimum and maximum */ 86/* Constants used for minimum and maximum */
86#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM) 87#if defined(CONFIG_DETECT_SOFTLOCKUP) || defined(CONFIG_HIGHMEM)
@@ -1190,7 +1191,9 @@ static struct ctl_table fs_table[] = {
1190 .data = &sysctl_nr_open, 1191 .data = &sysctl_nr_open,
1191 .maxlen = sizeof(int), 1192 .maxlen = sizeof(int),
1192 .mode = 0644, 1193 .mode = 0644,
1193 .proc_handler = &proc_dointvec, 1194 .proc_handler = &proc_dointvec_minmax,
1195 .extra1 = &sysctl_nr_open_min,
1196 .extra2 = &sysctl_nr_open_max,
1194 }, 1197 },
1195 { 1198 {
1196 .ctl_name = FS_DENTRY, 1199 .ctl_name = FS_DENTRY,