aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
committerJeff Garzik <jeff@garzik.org>2006-10-11 04:59:46 -0400
commit701328a7b58d50d8640c21ba5fdf3170b1ddac16 (patch)
tree99a3fe44310a97e92ad1cb3a01f2ee3f6ed0d59a /kernel
parent53e36ada37cb8b01cfbf674580a79edc0bb764c7 (diff)
parent53a5fbdc2dff55161a206ed1a1385a8fa8055c34 (diff)
Merge branch 'master' into upstream-fixes
Diffstat (limited to 'kernel')
-rw-r--r--kernel/audit.c3
-rw-r--r--kernel/cpuset.c2
-rw-r--r--kernel/futex.c15
-rw-r--r--kernel/futex_compat.c12
-rw-r--r--kernel/irq/resend.c2
-rw-r--r--kernel/power/user.c2
-rw-r--r--kernel/relay.c41
7 files changed, 41 insertions, 36 deletions
diff --git a/kernel/audit.c b/kernel/audit.c
index f9889ee77825..98106f6078b0 100644
--- a/kernel/audit.c
+++ b/kernel/audit.c
@@ -340,7 +340,7 @@ static int kauditd_thread(void *dummy)
340{ 340{
341 struct sk_buff *skb; 341 struct sk_buff *skb;
342 342
343 while (1) { 343 while (!kthread_should_stop()) {
344 skb = skb_dequeue(&audit_skb_queue); 344 skb = skb_dequeue(&audit_skb_queue);
345 wake_up(&audit_backlog_wait); 345 wake_up(&audit_backlog_wait);
346 if (skb) { 346 if (skb) {
@@ -369,6 +369,7 @@ static int kauditd_thread(void *dummy)
369 remove_wait_queue(&kauditd_wait, &wait); 369 remove_wait_queue(&kauditd_wait, &wait);
370 } 370 }
371 } 371 }
372 return 0;
372} 373}
373 374
374int audit_send_list(void *_dest) 375int audit_send_list(void *_dest)
diff --git a/kernel/cpuset.c b/kernel/cpuset.c
index 9d850ae13b1b..6313c38c930e 100644
--- a/kernel/cpuset.c
+++ b/kernel/cpuset.c
@@ -2137,7 +2137,7 @@ static int cpuset_handle_cpuhp(struct notifier_block *nb,
2137 * See also the previous routine cpuset_handle_cpuhp(). 2137 * See also the previous routine cpuset_handle_cpuhp().
2138 */ 2138 */
2139 2139
2140void cpuset_track_online_nodes() 2140void cpuset_track_online_nodes(void)
2141{ 2141{
2142 common_cpu_mem_hotplug_unplug(); 2142 common_cpu_mem_hotplug_unplug();
2143} 2143}
diff --git a/kernel/futex.c b/kernel/futex.c
index 4aaf91951a43..b364e0026191 100644
--- a/kernel/futex.c
+++ b/kernel/futex.c
@@ -1612,10 +1612,10 @@ sys_set_robust_list(struct robust_list_head __user *head,
1612 * @len_ptr: pointer to a length field, the kernel fills in the header size 1612 * @len_ptr: pointer to a length field, the kernel fills in the header size
1613 */ 1613 */
1614asmlinkage long 1614asmlinkage long
1615sys_get_robust_list(int pid, struct robust_list_head __user **head_ptr, 1615sys_get_robust_list(int pid, struct robust_list_head __user * __user *head_ptr,
1616 size_t __user *len_ptr) 1616 size_t __user *len_ptr)
1617{ 1617{
1618 struct robust_list_head *head; 1618 struct robust_list_head __user *head;
1619 unsigned long ret; 1619 unsigned long ret;
1620 1620
1621 if (!pid) 1621 if (!pid)
@@ -1694,14 +1694,15 @@ retry:
1694 * Fetch a robust-list pointer. Bit 0 signals PI futexes: 1694 * Fetch a robust-list pointer. Bit 0 signals PI futexes:
1695 */ 1695 */
1696static inline int fetch_robust_entry(struct robust_list __user **entry, 1696static inline int fetch_robust_entry(struct robust_list __user **entry,
1697 struct robust_list __user **head, int *pi) 1697 struct robust_list __user * __user *head,
1698 int *pi)
1698{ 1699{
1699 unsigned long uentry; 1700 unsigned long uentry;
1700 1701
1701 if (get_user(uentry, (unsigned long *)head)) 1702 if (get_user(uentry, (unsigned long __user *)head))
1702 return -EFAULT; 1703 return -EFAULT;
1703 1704
1704 *entry = (void *)(uentry & ~1UL); 1705 *entry = (void __user *)(uentry & ~1UL);
1705 *pi = uentry & 1; 1706 *pi = uentry & 1;
1706 1707
1707 return 0; 1708 return 0;
@@ -1739,7 +1740,7 @@ void exit_robust_list(struct task_struct *curr)
1739 return; 1740 return;
1740 1741
1741 if (pending) 1742 if (pending)
1742 handle_futex_death((void *)pending + futex_offset, curr, pip); 1743 handle_futex_death((void __user *)pending + futex_offset, curr, pip);
1743 1744
1744 while (entry != &head->list) { 1745 while (entry != &head->list) {
1745 /* 1746 /*
@@ -1747,7 +1748,7 @@ void exit_robust_list(struct task_struct *curr)
1747 * don't process it twice: 1748 * don't process it twice:
1748 */ 1749 */
1749 if (entry != pending) 1750 if (entry != pending)
1750 if (handle_futex_death((void *)entry + futex_offset, 1751 if (handle_futex_death((void __user *)entry + futex_offset,
1751 curr, pi)) 1752 curr, pi))
1752 return; 1753 return;
1753 /* 1754 /*
diff --git a/kernel/futex_compat.c b/kernel/futex_compat.c
index c5cca3f65cb7..50f24eea6cd0 100644
--- a/kernel/futex_compat.c
+++ b/kernel/futex_compat.c
@@ -18,7 +18,7 @@
18 */ 18 */
19static inline int 19static inline int
20fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry, 20fetch_robust_entry(compat_uptr_t *uentry, struct robust_list __user **entry,
21 compat_uptr_t *head, int *pi) 21 compat_uptr_t __user *head, int *pi)
22{ 22{
23 if (get_user(*uentry, head)) 23 if (get_user(*uentry, head))
24 return -EFAULT; 24 return -EFAULT;
@@ -62,7 +62,7 @@ void compat_exit_robust_list(struct task_struct *curr)
62 &head->list_op_pending, &pip)) 62 &head->list_op_pending, &pip))
63 return; 63 return;
64 if (upending) 64 if (upending)
65 handle_futex_death((void *)pending + futex_offset, curr, pip); 65 handle_futex_death((void __user *)pending + futex_offset, curr, pip);
66 66
67 while (compat_ptr(uentry) != &head->list) { 67 while (compat_ptr(uentry) != &head->list) {
68 /* 68 /*
@@ -70,7 +70,7 @@ void compat_exit_robust_list(struct task_struct *curr)
70 * dont process it twice: 70 * dont process it twice:
71 */ 71 */
72 if (entry != pending) 72 if (entry != pending)
73 if (handle_futex_death((void *)entry + futex_offset, 73 if (handle_futex_death((void __user *)entry + futex_offset,
74 curr, pi)) 74 curr, pi))
75 return; 75 return;
76 76
@@ -78,7 +78,7 @@ void compat_exit_robust_list(struct task_struct *curr)
78 * Fetch the next entry in the list: 78 * Fetch the next entry in the list:
79 */ 79 */
80 if (fetch_robust_entry(&uentry, &entry, 80 if (fetch_robust_entry(&uentry, &entry,
81 (compat_uptr_t *)&entry->next, &pi)) 81 (compat_uptr_t __user *)&entry->next, &pi))
82 return; 82 return;
83 /* 83 /*
84 * Avoid excessively long or circular lists: 84 * Avoid excessively long or circular lists:
@@ -103,10 +103,10 @@ compat_sys_set_robust_list(struct compat_robust_list_head __user *head,
103} 103}
104 104
105asmlinkage long 105asmlinkage long
106compat_sys_get_robust_list(int pid, compat_uptr_t *head_ptr, 106compat_sys_get_robust_list(int pid, compat_uptr_t __user *head_ptr,
107 compat_size_t __user *len_ptr) 107 compat_size_t __user *len_ptr)
108{ 108{
109 struct compat_robust_list_head *head; 109 struct compat_robust_list_head __user *head;
110 unsigned long ret; 110 unsigned long ret;
111 111
112 if (!pid) 112 if (!pid)
diff --git a/kernel/irq/resend.c b/kernel/irq/resend.c
index 35f10f7ff94a..5bfeaed7e487 100644
--- a/kernel/irq/resend.c
+++ b/kernel/irq/resend.c
@@ -38,7 +38,7 @@ static void resend_irqs(unsigned long arg)
38 clear_bit(irq, irqs_resend); 38 clear_bit(irq, irqs_resend);
39 desc = irq_desc + irq; 39 desc = irq_desc + irq;
40 local_irq_disable(); 40 local_irq_disable();
41 desc->handle_irq(irq, desc, NULL); 41 desc->handle_irq(irq, desc);
42 local_irq_enable(); 42 local_irq_enable();
43 } 43 }
44} 44}
diff --git a/kernel/power/user.c b/kernel/power/user.c
index 72825c853cd7..93b5dd283dea 100644
--- a/kernel/power/user.c
+++ b/kernel/power/user.c
@@ -145,10 +145,10 @@ static int snapshot_ioctl(struct inode *inode, struct file *filp,
145 error = freeze_processes(); 145 error = freeze_processes();
146 if (error) { 146 if (error) {
147 thaw_processes(); 147 thaw_processes();
148 enable_nonboot_cpus();
148 error = -EBUSY; 149 error = -EBUSY;
149 } 150 }
150 } 151 }
151 enable_nonboot_cpus();
152 up(&pm_sem); 152 up(&pm_sem);
153 if (!error) 153 if (!error)
154 data->frozen = 1; 154 data->frozen = 1;
diff --git a/kernel/relay.c b/kernel/relay.c
index 1d63ecddfa70..f04bbdb56ac2 100644
--- a/kernel/relay.c
+++ b/kernel/relay.c
@@ -887,7 +887,7 @@ static int subbuf_read_actor(size_t read_start,
887 887
888 from = buf->start + read_start; 888 from = buf->start + read_start;
889 ret = avail; 889 ret = avail;
890 if (copy_to_user(desc->arg.data, from, avail)) { 890 if (copy_to_user(desc->arg.buf, from, avail)) {
891 desc->error = -EFAULT; 891 desc->error = -EFAULT;
892 ret = 0; 892 ret = 0;
893 } 893 }
@@ -946,24 +946,17 @@ typedef int (*subbuf_actor_t) (size_t read_start,
946 */ 946 */
947static inline ssize_t relay_file_read_subbufs(struct file *filp, 947static inline ssize_t relay_file_read_subbufs(struct file *filp,
948 loff_t *ppos, 948 loff_t *ppos,
949 size_t count,
950 subbuf_actor_t subbuf_actor, 949 subbuf_actor_t subbuf_actor,
951 read_actor_t actor, 950 read_actor_t actor,
952 void *target) 951 read_descriptor_t *desc)
953{ 952{
954 struct rchan_buf *buf = filp->private_data; 953 struct rchan_buf *buf = filp->private_data;
955 size_t read_start, avail; 954 size_t read_start, avail;
956 read_descriptor_t desc;
957 int ret; 955 int ret;
958 956
959 if (!count) 957 if (!desc->count)
960 return 0; 958 return 0;
961 959
962 desc.written = 0;
963 desc.count = count;
964 desc.arg.data = target;
965 desc.error = 0;
966
967 mutex_lock(&filp->f_dentry->d_inode->i_mutex); 960 mutex_lock(&filp->f_dentry->d_inode->i_mutex);
968 do { 961 do {
969 if (!relay_file_read_avail(buf, *ppos)) 962 if (!relay_file_read_avail(buf, *ppos))
@@ -974,19 +967,19 @@ static inline ssize_t relay_file_read_subbufs(struct file *filp,
974 if (!avail) 967 if (!avail)
975 break; 968 break;
976 969
977 avail = min(desc.count, avail); 970 avail = min(desc->count, avail);
978 ret = subbuf_actor(read_start, buf, avail, &desc, actor); 971 ret = subbuf_actor(read_start, buf, avail, desc, actor);
979 if (desc.error < 0) 972 if (desc->error < 0)
980 break; 973 break;
981 974
982 if (ret) { 975 if (ret) {
983 relay_file_read_consume(buf, read_start, ret); 976 relay_file_read_consume(buf, read_start, ret);
984 *ppos = relay_file_read_end_pos(buf, read_start, ret); 977 *ppos = relay_file_read_end_pos(buf, read_start, ret);
985 } 978 }
986 } while (desc.count && ret); 979 } while (desc->count && ret);
987 mutex_unlock(&filp->f_dentry->d_inode->i_mutex); 980 mutex_unlock(&filp->f_dentry->d_inode->i_mutex);
988 981
989 return desc.written; 982 return desc->written;
990} 983}
991 984
992static ssize_t relay_file_read(struct file *filp, 985static ssize_t relay_file_read(struct file *filp,
@@ -994,8 +987,13 @@ static ssize_t relay_file_read(struct file *filp,
994 size_t count, 987 size_t count,
995 loff_t *ppos) 988 loff_t *ppos)
996{ 989{
997 return relay_file_read_subbufs(filp, ppos, count, subbuf_read_actor, 990 read_descriptor_t desc;
998 NULL, buffer); 991 desc.written = 0;
992 desc.count = count;
993 desc.arg.buf = buffer;
994 desc.error = 0;
995 return relay_file_read_subbufs(filp, ppos, subbuf_read_actor,
996 NULL, &desc);
999} 997}
1000 998
1001static ssize_t relay_file_sendfile(struct file *filp, 999static ssize_t relay_file_sendfile(struct file *filp,
@@ -1004,8 +1002,13 @@ static ssize_t relay_file_sendfile(struct file *filp,
1004 read_actor_t actor, 1002 read_actor_t actor,
1005 void *target) 1003 void *target)
1006{ 1004{
1007 return relay_file_read_subbufs(filp, ppos, count, subbuf_send_actor, 1005 read_descriptor_t desc;
1008 actor, target); 1006 desc.written = 0;
1007 desc.count = count;
1008 desc.arg.data = target;
1009 desc.error = 0;
1010 return relay_file_read_subbufs(filp, ppos, subbuf_send_actor,
1011 actor, &desc);
1009} 1012}
1010 1013
1011struct file_operations relay_file_operations = { 1014struct file_operations relay_file_operations = {