aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 20:58:07 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2018-01-30 20:58:07 -0500
commit168fe32a072a4b8dc81a3aebf0e5e588d38e2955 (patch)
tree297f0f6192256785979f5ebfb92797f81754548d /fs/proc
parent13ddd1667e7f01071cdf120132238ffca004a88e (diff)
parentc71d227fc4133f949dae620ed5e3a250b43f2415 (diff)
Merge branch 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull poll annotations from Al Viro: "This introduces a __bitwise type for POLL### bitmap, and propagates the annotations through the tree. Most of that stuff is as simple as 'make ->poll() instances return __poll_t and do the same to local variables used to hold the future return value'. Some of the obvious brainos found in process are fixed (e.g. POLLIN misspelled as POLL_IN). At that point the amount of sparse warnings is low and most of them are for genuine bugs - e.g. ->poll() instance deciding to return -EINVAL instead of a bitmap. I hadn't touched those in this series - it's large enough as it is. Another problem it has caught was eventpoll() ABI mess; select.c and eventpoll.c assumed that corresponding POLL### and EPOLL### were equal. That's true for some, but not all of them - EPOLL### are arch-independent, but POLL### are not. The last commit in this series separates userland POLL### values from the (now arch-independent) kernel-side ones, converting between them in the few places where they are copied to/from userland. AFAICS, this is the least disruptive fix preserving poll(2) ABI and making epoll() work on all architectures. As it is, it's simply broken on sparc - try to give it EPOLLWRNORM and it will trigger only on what would've triggered EPOLLWRBAND on other architectures. EPOLLWRBAND and EPOLLRDHUP, OTOH, are never triggered at all on sparc. With this patch they should work consistently on all architectures" * 'misc.poll' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: (37 commits) make kernel-side POLL... arch-independent eventpoll: no need to mask the result of epi_item_poll() again eventpoll: constify struct epoll_event pointers debugging printk in sg_poll() uses %x to print POLL... bitmap annotate poll(2) guts 9p: untangle ->poll() mess ->si_band gets POLL... bitmap stored into a user-visible long field ring_buffer_poll_wait() return value used as return value of ->poll() the rest of drivers/*: annotate ->poll() instances media: annotate ->poll() instances fs: annotate ->poll() instances ipc, kernel, mm: annotate ->poll() instances net: annotate ->poll() instances apparmor: annotate ->poll() instances tomoyo: annotate ->poll() instances sound: annotate ->poll() instances acpi: annotate ->poll() instances crypto: annotate ->poll() instances block: annotate ->poll() instances x86: annotate ->poll() instances ...
Diffstat (limited to 'fs/proc')
-rw-r--r--fs/proc/inode.c6
-rw-r--r--fs/proc/kmsg.c2
-rw-r--r--fs/proc/proc_sysctl.c4
3 files changed, 6 insertions, 6 deletions
diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index dd0f82622427..8dacaabb9f37 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -234,11 +234,11 @@ static ssize_t proc_reg_write(struct file *file, const char __user *buf, size_t
234 return rv; 234 return rv;
235} 235}
236 236
237static unsigned int proc_reg_poll(struct file *file, struct poll_table_struct *pts) 237static __poll_t proc_reg_poll(struct file *file, struct poll_table_struct *pts)
238{ 238{
239 struct proc_dir_entry *pde = PDE(file_inode(file)); 239 struct proc_dir_entry *pde = PDE(file_inode(file));
240 unsigned int rv = DEFAULT_POLLMASK; 240 __poll_t rv = DEFAULT_POLLMASK;
241 unsigned int (*poll)(struct file *, struct poll_table_struct *); 241 __poll_t (*poll)(struct file *, struct poll_table_struct *);
242 if (use_pde(pde)) { 242 if (use_pde(pde)) {
243 poll = pde->proc_fops->poll; 243 poll = pde->proc_fops->poll;
244 if (poll) 244 if (poll)
diff --git a/fs/proc/kmsg.c b/fs/proc/kmsg.c
index e0f8774acd65..f0bfb45c3f9f 100644
--- a/fs/proc/kmsg.c
+++ b/fs/proc/kmsg.c
@@ -40,7 +40,7 @@ static ssize_t kmsg_read(struct file *file, char __user *buf,
40 return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC); 40 return do_syslog(SYSLOG_ACTION_READ, buf, count, SYSLOG_FROM_PROC);
41} 41}
42 42
43static unsigned int kmsg_poll(struct file *file, poll_table *wait) 43static __poll_t kmsg_poll(struct file *file, poll_table *wait)
44{ 44{
45 poll_wait(file, &log_wait, wait); 45 poll_wait(file, &log_wait, wait);
46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC)) 46 if (do_syslog(SYSLOG_ACTION_SIZE_UNREAD, NULL, 0, SYSLOG_FROM_PROC))
diff --git a/fs/proc/proc_sysctl.c b/fs/proc/proc_sysctl.c
index c5cbbdff3c3d..63325377621a 100644
--- a/fs/proc/proc_sysctl.c
+++ b/fs/proc/proc_sysctl.c
@@ -630,12 +630,12 @@ static int proc_sys_open(struct inode *inode, struct file *filp)
630 return 0; 630 return 0;
631} 631}
632 632
633static unsigned int proc_sys_poll(struct file *filp, poll_table *wait) 633static __poll_t proc_sys_poll(struct file *filp, poll_table *wait)
634{ 634{
635 struct inode *inode = file_inode(filp); 635 struct inode *inode = file_inode(filp);
636 struct ctl_table_header *head = grab_header(inode); 636 struct ctl_table_header *head = grab_header(inode);
637 struct ctl_table *table = PROC_I(inode)->sysctl_entry; 637 struct ctl_table *table = PROC_I(inode)->sysctl_entry;
638 unsigned int ret = DEFAULT_POLLMASK; 638 __poll_t ret = DEFAULT_POLLMASK;
639 unsigned long event; 639 unsigned long event;
640 640
641 /* sysctl was unregistered */ 641 /* sysctl was unregistered */