History

Merge branch 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs

Pull aio fixes from Al Viro: "Assorted AIO followups and fixes" * 'work.aio' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: eventpoll: switch to ->poll_mask aio: only return events requested in poll_mask() for IOCB_CMD_POLL eventfd: only return events requested in poll_mask() aio: mark __aio_sigset::sigmask const

Linus Torvalds committed 8 years ago

Commit a5b729e2 parents 9215310 11c5ad04 files · +15 −10Browse files

Unified · Split

4 files
  1. fs/aio.c +2 −2
  2. fs/eventfd.c +2 −2
  3. fs/eventpoll.c +10 −5
  4. include/uapi/linux/aio_abi.h +1 −1
fs/aio.c+2−2
@@ -1661,7 +1661,7 @@ static int aio_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, · 1660 unmodified lines
16611661 if (mask && !(mask & req->events))
16621662 return 0;
16631663
1664− mask = file->f_op->poll_mask(file, req->events);
1664+ mask = file->f_op->poll_mask(file, req->events) & req->events;
16651665 if (!mask)
16661666 return 0;
16671667
@@ -1719,7 +1719,7 @@ static ssize_t aio_poll(struct aio_kiocb *aiocb, struct iocb *iocb) · 51 unmodified lines
17191719
17201720 spin_lock_irq(&ctx->ctx_lock);
17211721 spin_lock(&req->head->lock);
1722− mask = req->file->f_op->poll_mask(req->file, req->events);
1722+ mask = req->file->f_op->poll_mask(req->file, req->events) & req->events;
17231723 if (!mask) {
17241724 __add_wait_queue(req->head, &req->wait);
17251725 list_add_tail(&aiocb->ki_list, &ctx->active_reqs);
fs/eventfd.c+2−2
@@ -156,11 +156,11 @@ static __poll_t eventfd_poll_mask(struct file *file, __poll_t eventmask) · 155 unmodified lines
156156 count = READ_ONCE(ctx->count);
157157
158158 if (count > 0)
159− events |= EPOLLIN;
159+ events |= (EPOLLIN & eventmask);
160160 if (count == ULLONG_MAX)
161161 events |= EPOLLERR;
162162 if (ULLONG_MAX - 1 > count)
163− events |= EPOLLOUT;
163+ events |= (EPOLLOUT & eventmask);
164164
165165 return events;
166166 }
fs/eventpoll.c+10−5
@@ -922,13 +922,17 @@ static __poll_t ep_read_events_proc(struct eventpoll *ep, struct list_head *head · 921 unmodified lines
922922 return 0;
923923 }
924924
925−static __poll_t ep_eventpoll_poll(struct file *file, poll_table *wait)
925+static struct wait_queue_head *ep_eventpoll_get_poll_head(struct file *file,
926+ __poll_t eventmask)
926927 {
927928 struct eventpoll *ep = file->private_data;
928− int depth = 0;
929+ return &ep->poll_wait;
930+}
929931
930− /* Insert inside our poll wait queue */
931− poll_wait(file, &ep->poll_wait, wait);
932+static __poll_t ep_eventpoll_poll_mask(struct file *file, __poll_t eventmask)
933+{
934+ struct eventpoll *ep = file->private_data;
935+ int depth = 0;
932936
933937 /*
934938 * Proceed to find out if wanted events are really available inside
@@ -968,7 +972,8 @@ static const struct file_operations eventpoll_fops = { · 33 unmodified lines
968972 .show_fdinfo = ep_show_fdinfo,
969973 #endif
970974 .release = ep_eventpoll_release,
971− .poll = ep_eventpoll_poll,
975+ .get_poll_head = ep_eventpoll_get_poll_head,
976+ .poll_mask = ep_eventpoll_poll_mask,
972977 .llseek = noop_llseek,
973978 };
974979
include/uapi/linux/aio_abi.h+1−1
@@ -109,7 +109,7 @@ struct iocb { · 108 unmodified lines
109109 #undef IFLITTLE
110110
111111 struct __aio_sigset {
112− sigset_t __user *sigmask;
112+ const sigset_t __user *sigmask;
113113 size_t sigsetsize;
114114 };
115115

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t