From c71d227fc4133f949dae620ed5e3a250b43f2415 Mon Sep 17 00:00:00 2001 From: Al Viro Date: Wed, 29 Nov 2017 19:00:41 -0500 Subject: make kernel-side POLL... arch-independent mangle/demangle on the way to/from userland Signed-off-by: Al Viro --- fs/fcntl.c | 2 +- fs/fuse/file.c | 4 ++-- fs/select.c | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'fs') diff --git a/fs/fcntl.c b/fs/fcntl.c index afe731c7a5a8..84bab55b4712 100644 --- a/fs/fcntl.c +++ b/fs/fcntl.c @@ -758,7 +758,7 @@ static void send_sigio_to_task(struct task_struct *p, if (reason - POLL_IN >= NSIGPOLL) si.si_band = ~0L; else - si.si_band = (__force long)band_table[reason - POLL_IN]; + si.si_band = mangle_poll(band_table[reason - POLL_IN]); si.si_fd = fd; if (!do_send_sig_info(signum, &si, p, group)) break; diff --git a/fs/fuse/file.c b/fs/fuse/file.c index fa4ca6bd2c96..e85e974dd211 100644 --- a/fs/fuse/file.c +++ b/fs/fuse/file.c @@ -2764,7 +2764,7 @@ __poll_t fuse_file_poll(struct file *file, poll_table *wait) return DEFAULT_POLLMASK; poll_wait(file, &ff->poll_wait, wait); - inarg.events = (__u32)poll_requested_events(wait); + inarg.events = mangle_poll(poll_requested_events(wait)); /* * Ask for notification iff there's someone waiting for it. @@ -2786,7 +2786,7 @@ __poll_t fuse_file_poll(struct file *file, poll_table *wait) err = fuse_simple_request(fc, &args); if (!err) - return outarg.revents; + return demangle_poll(outarg.revents); if (err == -ENOSYS) { fc->no_poll = 1; return DEFAULT_POLLMASK; diff --git a/fs/select.c b/fs/select.c index b2deeb215dbe..ec14171dd78a 100644 --- a/fs/select.c +++ b/fs/select.c @@ -817,7 +817,7 @@ static inline __poll_t do_pollfd(struct pollfd *pollfd, poll_table *pwait, mask = POLLNVAL; if (f.file) { /* userland u16 ->events contains POLL... bitmap */ - __poll_t filter = (__force __poll_t)pollfd->events | + __poll_t filter = demangle_poll(pollfd->events) | POLLERR | POLLHUP; mask = DEFAULT_POLLMASK; if (f.file->f_op->poll) { @@ -833,7 +833,7 @@ static inline __poll_t do_pollfd(struct pollfd *pollfd, poll_table *pwait, } } /* ... and so does ->revents */ - pollfd->revents = (__force u16)mask; + pollfd->revents = mangle_poll(mask); return mask; } -- cgit v1.2.3