Commit 68b11e8
io_uring: explicitly count entries for poll reqs
If __io_queue_proc() fails to add a second poll entry, e.g. kmalloc()
failed, but it goes on with a third waitqueue, it may succeed and
overwrite the error status. Count the number of poll entries we added,
so we can set pt->error to zero at the beginning and find out when the
mentioned scenario happens.
Cc: stable@vger.kernel.org
Fixes: 18bceab ("io_uring: allow POLL_ADD with double poll_wait() users")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/9d6b9e561f88bcc0163623b74a76c39f712151c3.1626774457.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>1 parent 1b48773 commit 68b11e8
1 file changed
Lines changed: 10 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4802 | 4802 | | |
4803 | 4803 | | |
4804 | 4804 | | |
| 4805 | + | |
4805 | 4806 | | |
4806 | 4807 | | |
4807 | 4808 | | |
| |||
4995 | 4996 | | |
4996 | 4997 | | |
4997 | 4998 | | |
4998 | | - | |
4999 | | - | |
5000 | | - | |
| 4999 | + | |
| 5000 | + | |
| 5001 | + | |
5001 | 5002 | | |
5002 | | - | |
| 5003 | + | |
5003 | 5004 | | |
5004 | 5005 | | |
5005 | 5006 | | |
| |||
5027 | 5028 | | |
5028 | 5029 | | |
5029 | 5030 | | |
5030 | | - | |
| 5031 | + | |
5031 | 5032 | | |
5032 | 5033 | | |
5033 | 5034 | | |
| |||
5104 | 5105 | | |
5105 | 5106 | | |
5106 | 5107 | | |
5107 | | - | |
| 5108 | + | |
| 5109 | + | |
5108 | 5110 | | |
5109 | 5111 | | |
| 5112 | + | |
| 5113 | + | |
5110 | 5114 | | |
5111 | 5115 | | |
5112 | 5116 | | |
| |||
0 commit comments