aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2008-02-13 15:03:19 -0800
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 16:21:18 -0800
commit064d9efe947542097be669581f82d6b097e81d1a (patch)
treeddfc9f1c4d60135a7d7a1c5ebb7d0e85f683cfcb /kernel/sysctl.c
parent2695a14d315c014474ccadbaed40b0169b00cb5b (diff)
downloadkernel_samsung_smdk4412-064d9efe947542097be669581f82d6b097e81d1a.zip
kernel_samsung_smdk4412-064d9efe947542097be669581f82d6b097e81d1a.tar.gz
kernel_samsung_smdk4412-064d9efe947542097be669581f82d6b097e81d1a.tar.bz2
hugetlb: fix overcommit locking
proc_doulongvec_minmax() calls copy_to_user()/copy_from_user(), so we can't hold hugetlb_lock over the call. Use a dummy variable to store the sysctl result, like in hugetlb_sysctl_handler(), then grab the lock to update nr_overcommit_huge_pages. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Reported-by: Miles Lane <miles.lane@gmail.com> Cc: Adam Litke <agl@us.ibm.com> Cc: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'kernel/sysctl.c')
-rw-r--r--kernel/sysctl.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/kernel/sysctl.c b/kernel/sysctl.c
index 924c674..8b7e954 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -978,8 +978,8 @@ static struct ctl_table vm_table[] = {
{
.ctl_name = CTL_UNNUMBERED,
.procname = "nr_overcommit_hugepages",
- .data = &nr_overcommit_huge_pages,
- .maxlen = sizeof(nr_overcommit_huge_pages),
+ .data = &sysctl_overcommit_huge_pages,
+ .maxlen = sizeof(sysctl_overcommit_huge_pages),
.mode = 0644,
.proc_handler = &hugetlb_overcommit_handler,
},