aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/sysctl.c
diff options
context:
space:
mode:
authorNishanth Aravamudan <nacc@us.ibm.com>2008-02-13 18:03:19 -0500
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2008-02-13 19:21:18 -0500
commit064d9efe947542097be669581f82d6b097e81d1a (patch)
treeddfc9f1c4d60135a7d7a1c5ebb7d0e85f683cfcb /kernel/sysctl.c
parent2695a14d315c014474ccadbaed40b0169b00cb5b (diff)
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 924c674b76ea..8b7e95411795 100644
--- a/kernel/sysctl.c
+++ b/kernel/sysctl.c
@@ -978,8 +978,8 @@ static struct ctl_table vm_table[] = {
978 { 978 {
979 .ctl_name = CTL_UNNUMBERED, 979 .ctl_name = CTL_UNNUMBERED,
980 .procname = "nr_overcommit_hugepages", 980 .procname = "nr_overcommit_hugepages",
981 .data = &nr_overcommit_huge_pages, 981 .data = &sysctl_overcommit_huge_pages,
982 .maxlen = sizeof(nr_overcommit_huge_pages), 982 .maxlen = sizeof(sysctl_overcommit_huge_pages),
983 .mode = 0644, 983 .mode = 0644,
984 .proc_handler = &hugetlb_overcommit_handler, 984 .proc_handler = &hugetlb_overcommit_handler,
985 }, 985 },