[COMMIT osv master] epoll: don't pass unknown bits to poll()

2018-05-17 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master epoll: don't pass unknown bits to poll() Our epoll implementation is based on poll(). We should only pass to poll the event bits we know are identical between epoll and poll(). In particular,

[COMMIT osv master] poll: don't return POLLNVAL from poll_no_poll()

2018-05-17 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master poll: don't return POLLNVAL from poll_no_poll() The trivial poll_no_poll() returned POLLNVAL if it got a bit it doesn't recognize. This is wrong: poll() should ignore bits it doesn't recognize and

[COMMIT osv master] epoll: test polling of /proc file

2018-05-17 Thread Commit Bot
From: Nadav Har'El Committer: Nadav Har'El Branch: master epoll: test polling of /proc file This test reproduces issue #971, and verifies that we fixed it in the previous patches. It epolls a file from /proc - Linux doesn't allow epolling an ext4 file,

[PATCH] epoll: test polling of /proc file

2018-05-17 Thread Nadav Har'El
This test reproduces issue #971, and verifies that we fixed it in the previous patches. It epolls a file from /proc - Linux doesn't allow epolling an ext4 file, but does allow to do that on /proc files. It then verifies that epoll doesn't crash even with unorthodox request bits (as happened in

[PATCH 1/2] epoll: don't pass unknown bits to poll()

2018-05-17 Thread Nadav Har'El
Our epoll implementation is based on poll(). We should only pass to poll the event bits we know are identical between epoll and poll(). In particular, EPOLLET and EPOLLONESHOT shouldn't be passed to poll(). Before this patch we passed EPOLLET and EPOLLONESHOT on to poll(), which could confuse

[PATCH 2/2] poll: don't return POLLNVAL from poll_no_poll()

2018-05-17 Thread Nadav Har'El
The trivial poll_no_poll() returned POLLNVAL if it got a bit it doesn't recognize. This is wrong: poll() should ignore bits it doesn't recognize and poll(1) states that POLLNVAL is only to be returned if the file descriptor isn't open. This patch just drops the wrong test. Before this patch,